TWaver Java Performance Report

13
TWaver ® Java Performance Report Nov 2010 Serva Software [email protected] http://www.servasoftware.com PO Box 8143, Wichita Falls, Texas, USA 76307

description

TWaver is a GUI toolkit which provides Network component and other commonly used components including tree, table, chart, property sheet, list, etc.

Transcript of TWaver Java Performance Report

Page 1: TWaver Java Performance Report

TWaver® Java

Performance Report

Nov 2010 Serva Software [email protected] http://www.servasoftware.com PO Box 8143, Wichita Falls, Texas, USA 76307

Page 2: TWaver Java Performance Report

For more information about Serva Software and TWaver please visit the web site at: http://www.servasoftware.com Or send e-mail to:

[email protected] Nov, 2010 Notice: This document contains proprietary information of Serva Software. Possession and use of this document shall be strictly in accordance with a license agreement between the user and Serva Software, and receipt or possession of this document does not convey any rights to reproduce or disclose its contents, or to manufacture, use, or sell anything it may describe. It may not be reproduced, disclosed, or used by others without specific written authorization of Serva Software. TWaver, servasoft, Serva Software and the logo are registered trademarks of Serva Software. Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S.A. and other countries. Other company, brand, or product names are trademarks or registered trademarks of their respective holders. The information contained in this document is subject to change without notice at the discretion of Serva Software. Copyright © 2010 Serva Software LLC All Rights Reserved

Page 3: TWaver Java Performance Report

 

Copy

High

In thdisp

Test

Test

 

Test

yright © 2010 S

h Performanc

his test, a nuplay on a Net

t Environme

TWaver  Java(TM Mac OSX 2.26 GH

t 1 

Node: cr Link: no 

t 2 

Node: cr Link: nu

       

erva Software A

ce is a key be

mber of Nodtwork compo

nt 

Java 3.6 M) SE RuntimeX 10.6.4 z Intel Core 

reate Node eLink elemen

reate Node ember of Nod

                     

All Rights Reser

enefit of TW

des and Linksonent. 

e Environme

2 Duo 

element withnt 

element withde number o

                      

rved                   

Waver. Here is

s are created

ent (build 1.6

hout image

hout imagef Link = 5:1

                      

                           

s a simple te

d randomly a

6.0_22‐b04‐3

TWaver Java P

                          

st of TWave

and added in

307‐10M326

Performance Re

         

r's performa

nto the DataB

61) 

eport 

ance. 

Box to 

 

 

Page 4: TWaver Java Performance Report

 

Copy

Test

 

Test

 

Sou

pack

 

imp

imp

imp

yright © 2010 S

t 3 

Node: cr Link: no 

t 4 

Node: cr Link: nu

rce Code: 

kage model.d

ort java.awt

ort java.awt

ort java.awt

       

erva Software A

reate Node eLink elemen

reate Node ember of Nod

databox; 

.BorderLayo

.Color; 

.Dimension; 

                     

All Rights Reser

element withnt 

element withde number o

ut; 

                      

rved                   

h image 

h image f Link = 5:1

                      

                           

TWaver Java P

                          

Performance Re

         

eport 

 

 

Page 5: TWaver Java Performance Report

 

Copy

imp

imp

imp

imp

imp

imp

 

imp

imp

imp

imp

imp

imp

imp

imp

 

imp

imp

imp

imp

imp

imp

imp

imp

imp

yright © 2010 S

ort java.awt

ort java.awt

ort java.awt

ort java.awt

ort java.util.A

ort java.util.

ort javax.sw

ort javax.sw

ort javax.sw

ort javax.sw

ort javax.sw

ort javax.sw

ort javax.sw

ort javax.sw

ort twaver.L

ort twaver.N

ort twaver.R

ort twaver.T

ort twaver.T

ort twaver.T

ort twaver.T

ort twaver.c

ort twaver.n

       

erva Software A

.Graphics; 

.GridLayout;

.event.Actio

.event.Actio

ArrayList; 

List; 

ing.JButton; 

ing.JCheckBo

ing.JCompon

ing.JFrame; 

ing.JLabel; 

ing.JPanel; 

ing.JTextFiel

ing.SwingUti

Link; 

Node; 

ResizableNod

TDataBox; 

TUIManager;

TWaverConst

TWaverUtil; 

hart.BarCha

network.Canv

                     

All Rights Reser

 

nEvent; 

nListener; 

ox; 

nent; 

d; 

ilities; 

de; 

 

t; 

rt; 

vasPaintAda

                      

rved                   

pter; 

                      

                           

TWaver Java P

                          

Performance Re

         

eport 

Page 6: TWaver Java Performance Report

 

Copy

imp

 

pub

 

 priv

 priv

  

 priv

 priv

 priv

 priv

 priv

 priv

 priv

  

 priv

 priv

 priv

 priv

 priv

 priv

  

 priv

  if(s

   lon

yright © 2010 S

ort twaver.n

lic class Perf

vate int stepC

vate int unitN

vate int curre

vate long sta

vate TDataBo

vate Node bo

vate Node ne

vate TDataBo

vate BarChar

vate JCheckB

vate JCheckB

vate JTextFie

vate JTextFie

vate JButton 

vate TNetwo

vate void afte

startTime > 0

ng time = Sys

       

erva Software A

network.TNe

formanceTes

Count = 5; 

Number = 10

entStep = 0; 

rtTime = ‐1; 

ox box = new

oxLoad = new

etworkLoad =

ox report = n

rt chart = new

Box withLink 

Box widthIma

eld stepCoun

eld unitNumb

button = ne

rk network =

erPaintProce

0){ 

stem.current

                     

All Rights Reser

twork; 

st extends JP

000; 

w TDataBox()

w Node(); 

= new Node

new TDataBo

w BarChart(r

= new JChec

age = new JC

tField = new

berField = ne

w JButton("P

= new TNetw

ess(){ 

tTimeMillis()

                      

rved                   

anel implem

); 

(); 

ox(); 

report); 

ckBox("with 

CheckBox("w

w JTextField(s

ew JTextField

Press to Star

work(box); 

) ‐ startTime;

                      

                           

ments ActionL

link"); 

with image");

stepCount + 

d(unitNumbe

rt Loading..."

TWaver Java P

                          

Listener{ 

""); 

er + ""); 

"); 

Performance Re

         

eport 

Page 7: TWaver Java Performance Report

 

Copy

   ne

    

   cu

   sta

    

   if(c

    Sw

     p

      s

     } 

    });

   }el

    bu

    st

    un

   } 

  } 

 } 

  

 pub

  sup

  net

   pu

    af

   } 

yright © 2010 S

etworkLoad.a

rrentStep‐‐; 

artTime = ‐1;

currentStep 

wingUtilities

public void ru

step(); 

lse{ 

utton.setEna

tepCountFiel

nitNumberFi

blic Performa

per(new Bord

twork.addCa

ublic void aft

fterPaintProc

       

erva Software A

addChartVal

> 0){ 

.invokeLater

un() { 

abled(true); 

d.setEnabled

ield.setEnab

anceTest(){ 

derLayout())

anvasPaintLis

erPaint(Grap

cess(); 

                     

All Rights Reser

ue(time); 

r(new Runna

d(true); 

led(true); 

); 

stener(new C

phics g) { 

                      

rved                   

ble(){ 

CanvasPaintA

                      

                           

Adapter(){ 

TWaver Java P

                          

Performance Re

         

eport 

Page 8: TWaver Java Performance Report

 

Copy

  }); 

   

  rep

  rep

   

  box

  net

  box

  net

 

  cha

  cha

  cha

  cha

  cha

  cha

//  c

  cha

  cha

  cha

   

  but

  but

   

  ste

yright © 2010 S

port.addElem

port.addElem

xLoad.setNa

tworkLoad.s

xLoad.putCh

tworkLoad.p

art.setYAxisT

art.setTitle("

art.setValueT

art.setShado

art.setSelect

art.setBarTyp

chart.setXSca

art.setXScale

art.setLazyPu

art.setXAxisT

tton.addActi

tton.setBack

epCountField

       

erva Software A

ment(this.box

ment(this.net

me("DataBo

etName("Ne

hartColor(Col

putChartColo

Text("Time C

TWaver Perf

TextFont(TU

owOffset(0); 

edOffset(0);

pe(TWaverC

aleTextOrien

eTextColor(C

ublishMode(

Text("Numbe

ionListener(t

kground(Colo

d.setPreferre

                     

All Rights Reser

xLoad); 

tworkLoad);

ox Loading Ti

etwork Loadi

lor.BLUE.dar

or(Color.GRE

onsuming (m

formance Re

IManager.ge

 

onst.BAR_TY

tation(TWav

olor.RED); 

(true); 

ers of Elemen

this); 

or.ORANGE);

edSize(new D

                      

rved                   

me"); 

ing Time"); 

rker()); 

EN.darker())

ms)"); 

eport"); 

etDefaultFon

YPE_GROUP)

verConst.LAB

nt"); 

Dimension(80

                      

                           

nt().deriveFo

); 

BEL_ORIENTA

0, 20)); 

TWaver Java P

                          

nt(9f)); 

ATION_RIGH

Performance Re

         

HT); 

eport 

Page 9: TWaver Java Performance Report

 

Copy

  uni

  JPa

  con

  con

  con

  con

  con

  con

  con

   

     JP

     p

     p

  this

  this

  

 } 

 

 pub

  but

  ste

  uni

   

  try

   th

yright © 2010 S

itNumberFie

anel controlP

ntrolPane.ad

ntrolPane.ad

ntrolPane.ad

ntrolPane.ad

ntrolPane.ad

ntrolPane.ad

ntrolPane.ad

Panel pane =

pane.add(net

pane.add(cha

s.add(pane, 

s.add(contro

blic void actio

tton.setEnab

epCountField

itNumberFie

is.stepCount

       

erva Software A

eld.setPrefer

Pane = new J

dd(widthImag

dd(withLink);

dd(new JLabe

dd(stepCount

dd(new JLabe

dd(unitNumb

dd(button); 

= new JPanel

twork); 

art); 

BorderLayou

olPane, Bord

onPerformed

bled(false); 

d.setEnabled

eld.setEnable

t = Integer.pa

                     

All Rights Reser

redSize(new

Panel(); 

ge); 

el("step coun

tField); 

el("node cou

berField); 

(new GridLa

ut.CENTER);

erLayout.SO

d(ActionEven

(false); 

ed(false); 

arseInt(this.s

                      

rved                   

w Dimension(

nt")); 

unt")); 

ayout(2, 1));

OUTH); 

nt e) { 

stepCountFie

                      

                           

(80, 20)); 

eld.getText()

TWaver Java P

                          

)); 

Performance Re

         

eport 

Page 10: TWaver Java Performance Report

 

Copy

  }ca

   th

  } 

  try

   th

  }ca

   th

  } 

   

  this

  this

  this

  this

 

  this

 } 

  

 priv

  this

  this

  int 

  int 

  lon

  if(li

   th

yright © 2010 S

atch(Exceptio

is.stepCount

is.unitNumb

atch(Exceptio

is.unitNumb

s.currentSte

s.chart.setXS

s.boxLoad.se

s.networkLo

s.step(); 

vate void ste

s.box.clear()

s.startTime =

sum=getSum

linkCount = 

ng time = loa

inkCount>0)

is.chart.addX

       

erva Software A

on ex){ 

tField.setTex

er = Integer.

on ex){ 

erField.setTe

p = stepCoun

ScaleTextList

etChartValue

oad.setChartV

p(){ 

= System.cur

m(stepCount

withLink.isS

dNode(box, 

XScaleText("

                     

All Rights Reser

xt(this.stepCo

.parseInt(thi

ext(this.unit

nt; 

t(null); 

es(null); 

Values(null);

rrentTimeMi

t‐currentStep

elected() ? (

sum, linkCou

<html>"+sum

                      

rved                   

ount + ""); 

s.unitNumbe

Number + ""

 

illis(); 

p, unitNumb

int)(sum*0.2

unt, widthIm

m + " Nodes 

                      

                           

erField.getTe

"); 

ber); 

2) : 0; 

mage.isSelect

<br>"+linkC

TWaver Java P

                          

ext()); 

ted(), 1000, 1

ount+" Links

Performance Re

         

1000); 

s</html>"); 

eport 

Page 11: TWaver Java Performance Report

 

Copy

  }els

   th

  } 

  this

 } 

  

 pro

  ret

 } 

 pub

  sho

 } 

    puxLim

        

        

        

        

        

        

        

        

        

        

        

        

yright © 2010 S

se{ 

is.chart.addX

s.boxLoad.ad

tected int ge

turn (int)(uni

blic static voi

owFrame("D

ublic static lomit, int yLimit

List allNode

 

long time1 =

for (int i = 0

    Node nod

    if (useIcon

        node = 

    } else { 

        node = 

        ((Resiza

        node.p

        node.p

       

erva Software A

XScaleText(s

ddChartValu

etSum(int cu

itNumber*(M

d main(Strin

ataBox Load

ong loadNodt){ 

es = new Arra

= System.cur

0; i < nodeCo

de = null; 

n) { 

new Node()

new Resizab

ableNode) no

utCustomDr

utCustomDr

                     

All Rights Reser

um + " Node

e(time); 

rrentStep,in

Math.pow(2,

ng[] args) { 

ding Test", ne

de(TDataBox 

ayList(nodeC

rrentTimeMi

unt; i++) { 

bleNode(); 

ode).setSize(

raw(true); 

rawShapeFac

                      

rved                   

es"); 

t unitNumbe

currentStep

ew Performa

box,int node

Count); 

illis(); 

(12, 12); 

ctory(TWave

                      

                           

er){ 

))); 

anceTest());

eCount, int l

erConst.SHAP

TWaver Java P

                          

inkCount, bo

PE_CIRCLE);

Performance Re

         

oolean useIco

eport 

on, int 

Page 12: TWaver Java Performance Report

 

Copy

        

        

        

        

        

 

        

        

 

        

        

        

        

 

        

        

        

        

        

        

        

        

        

        

        

yright © 2010 S

        node.p

        node.p

        node.p

        node.p

    } 

    int x = TW

    int y = TW

    node.setL

    box.addE

    allNodes.

for (int i = 0

    Node nod

    Node nod

     

    Link link =

    link.putLi

    link.putLi

    link.putLi

    link.putBo

    box.addE

       

erva Software A

utCustomDr

utCustomDr

utBorderCol

utCustomDr

WaverUtil.get

WaverUtil.get

Location(x, y

lement(node

add(node); 

0; i < linkCoun

de1 = (Node)

de2 = (Node)

= new Link(n

nkWidth(0); 

nkOutlineW

nkColor(Colo

orderColor(C

lement(link)

                     

All Rights Reser

rawFillColor(

rawOutline(fa

or(Color.WH

rawGradient

tRandomInt(

tRandomInt(

y); 

e); 

nt; i++) { 

)allNodes.get

)allNodes.get

ode1, node2

idth(0); 

or.YELLOW);

Color.WHITE

                      

rved                   

Color.GREEN

alse); 

HITE); 

Factory(TWa

(xLimit); 

(yLimit); 

t(TWaverUti

t(TWaverUti

2); 

); 

                      

                           

N); 

averConst.GR

il.getRandom

il.getRandom

TWaver Java P

                          

RADIENT_RA

mInt(nodeCo

mInt(nodeCo

Performance Re

         

ADIAL_NW); 

unt)); 

unt)); 

eport 

10 

Page 13: TWaver Java Performance Report

 

Copy

        

    } 

     

 pub

  JFr

  fra

  fra

  fra

  fra

  TW

  fra

  ret

 } 

 

 

yright © 2010 S

return Syste

blic static JFr

ame frame =

me.setTitle(t

me.getConte

me.setSize(7

me.setDefau

WaverUtil.cen

me.setVisibl

turn frame; 

       

erva Software A

em.currentTi

ame showFr

= new JFram

title); 

entPane().ad

700, 550); 

ultCloseOper

nterWindow

e(true); 

                     

All Rights Reser

imeMillis()‐t

rame(String t

e(); 

dd(compone

ration(JFram

(frame); 

                      

rved                   

ime1; 

title, JCompo

nt, BorderLa

me.EXIT_ON_

                      

                           

onent compo

ayout.CENTE

_CLOSE); 

TWaver Java P

                          

onent) { 

R); 

Performance Re

         

eport 

11