input
stringlengths 10
828
| output
stringlengths 5
107
|
|---|---|
public void set graph layout layout v e layout set graph layout layout null
|
set the graph layout and if it is not already initialized initialize
|
public shape transform context graph v e e context return instance
|
getter for the shape
|
public int get index graph v e graph e e if predicate evaluate e return 0 integer index edge index get e if index null pair v endpoints graph get endpoints e v u endpoints get first v v endpoints get second if u equals v index get index graph e v else index get index graph e u v return index int value
|
returns the index for the specified edge
|
public shape transform context graph v e e context graph v e graph context graph e e context element int count 1 if parallel edge index function null count parallel edge index function get index graph e float x 5f float y 5f float diam 1 f diam diam count 2 x x count 2 y y count 2 instance set frame x y diam diam return instance
|
get the shape for this edge modifying the diameter in the
|
public string transform string str if str null return wrap str else return null
|
call wrap to transform the passed string
|
private string wrap string str string builder buf new string builder str int len line length while len buf length int idx buf last index of len if idx 1 buf replace idx idx 1 breaker len idx breaker length line length else buf insert len breaker len breaker length line length buf insert 0 html return buf to string
|
line wrap the passed string as an html string with
|
public void fire state changed guaranteed to return a non null array object listeners listener list get listener list process the listeners last to first notifying those that are interested in this event for int i listeners length 2 i 0 i 2 if listeners i change listener class lazily create the event if change event null change event new change event event source change listener listeners i 1 state changed change event
|
notifies all listeners that have registered interest for
|
public affine transform get reverse arrow transform render context v e rc general path edge shape shape vertex shape return get reverse arrow transform rc edge shape vertex shape true
|
returns a transform to position the arrowhead on this edge shape at the
|
public affine transform get reverse arrow transform render context v e rc shape edge shape shape vertex shape return get reverse arrow transform rc edge shape vertex shape true
|
returns a transform to position the arrowhead on this edge shape at the
|
protected line2 d get first outside segment line2 d line shape shape if shape contains line get p1 false string error string line start point line get p1 is not contained in shape shape get bounds2 d throw new illegal argument exception error string line2 d left new line2 d float line2 d right new line2 d float subdivide the line until its right side intersects the shape boundary do subdivide line left right line left while shape contains line get p2 false now that left is completely inside shape return right which must be partially outside return right
|
passed lines point1 must be inside the passed shape or
|
public void mouse entered mouse event e jcomponent c jcomponent e get source c set cursor cursor
|
show a special cursor while the mouse is inside the window
|
public void mouse exited mouse event e jcomponent c jcomponent e get source c set cursor cursor get predefined cursor cursor default cursor
|
revert to the default cursor when the mouse leaves this window
|
private v get vertex point2 d point adjust for scale and offset in the visualization viewer point2 d p point vv get render context get basic transformer inverse view transform point graph element accessor v e pick support vv get pick support layout v e layout vv get graph layout v v null if pick support null v pick support get vertex layout p get x p get y return v
|
transform the point to the coordinate system in the
|
public void mouse wheel moved mouse wheel event e boolean accepted check modifiers e if accepted true visualization viewer vv visualization viewer e get source point2 d mouse e get point point2 d center vv get center int amount e get wheel rotation if zoom at mouse if amount 0 scaler scale vv in mouse else if amount 0 scaler scale vv out mouse else if amount 0 scaler scale vv in center else if amount 0 scaler scale vv out center e consume vv repaint
|
zoom the display in or out depending on the direction of the
|
private boolean hey thats too close point2 d p point2 d q double min return math abs p get x q get x min math abs p get y q get y min
|
rejects picking if the rectangle is too small like
|
protected void pick contained vertices visualization viewer v e vv point2 d down point2 d out boolean clear layout v e layout vv get graph layout picked state v picked vertex state vv get picked vertex state rectangle2 d pick rectangle new rectangle2 d double pick rectangle set frame from diagonal down out if picked vertex state null if clear picked vertex state clear graph element accessor v e pick support vv get pick support collection v picked pick support get vertices layout pick rectangle for v v picked picked vertex state pick v true
|
pick the vertices inside the rectangle created from points
|
public void mouse released mouse event e if e is popup trigger handle popup e e consume
|
if this is the popup trigger process here otherwise
|
public void mouse pressed mouse event e visualization viewer vv visualization viewer e get source boolean accepted check modifiers e down e get point if accepted vv set cursor cursor
|
check the event modifiers
|
public void mouse released mouse event e visualization viewer vv visualization viewer e get source down null vv set cursor cursor get predefined cursor cursor default cursor
|
unset the down point and change the cursoe back to the system
|
private void set view center mutable transformer transformer point2 d point if transformer instanceof lens transformer lens transformer ht lens transformer transformer ht set view center point
|
called to change the location of the lens
|
public void set crossover double crossover this crossover crossover
|
sets the crossover point to the specified value
|
private void set view radius mutable transformer transformer point2 d point if transformer instanceof lens transformer lens transformer ht lens transformer transformer double distance from center ht get distance from center point ht set view radius distance from center edge offset
|
called to change the radius of the lens
|
public double get crossover return crossover
|
returns the current crossover value
|
public void scale visualization server vv float amount point2 d from point2 d ivtfrom vv get render context get multi layer transformer inverse transform layer view from mutable transformer model transformer vv get render context get multi layer transformer get transformer layer layout model transformer scale amount amount ivtfrom vv repaint
|
zoom the display in or out depending on the direction of the
|
private void test view center mutable transformer transformer point2 d point if transformer instanceof lens transformer lens transformer ht lens transformer transformer double distance from center ht get distance from center point if distance from center 10 ht set view center point drag on lens true else if math abs distance from center ht get view radius 10 edge offset ht get view radius distance from center ht set view radius distance from center edge offset drag on edge true
|
called to set up translating the lens center or changing the size
|
public void mouse released mouse event e super mouse released e drag on lens false drag on edge false edge offset 0
|
unset the down point and change the cursoe back to the system
|
public void set mode mode mode if this mode mode fire item state changed new item event this item event item state changed this mode item event deselected this mode mode if mode mode transforming set transforming mode else if mode mode picking set picking mode if mode box null mode box set selected item mode fire item state changed new item event this item event item state changed mode item event selected
|
setter for the mode
|
private void transform edge shape point2 d down point2 d out float x1 float down get x float y1 float down get y float x2 float out get x float y2 float out get y affine transform xform affine transform get translate instance x1 y1 float dx x2 x1 float dy y2 y1 float theta radians float math atan2 dy dx xform rotate theta radians float dist float math sqrt dx dx dy dy xform scale dist raw edge get bounds get width 1 0 edge shape xform create transformed shape raw edge
|
code lifted from pluggable renderer to move an edge shape into an
|
public boolean check modifiers mouse event e return e get modifiers modifiers 0
|
override to check equality with a mask
|
public void mouse wheel moved mouse wheel event e boolean accepted check modifiers e float delta this delta if accepted true visualization viewer vv visualization viewer e get source mutable transformer model transformer vv get render context get multi layer transformer get transformer layer layout mutable transformer view transformer vv get render context get multi layer transformer get transformer layer view int amount e get wheel rotation if amount 0 delta delta change magnification model transformer delta change magnification view transformer delta vv repaint e consume
|
zoom the display in or out depending on the direction of the
|
public boolean check modifiers mouse event e return e get modifiers modifiers
|
check the mouse event modifiers against the
|
public void scale visualization server vv float amount point2 d from mutable transformer view transformer vv get render context get multi layer transformer get transformer layer view view transformer scale amount amount from vv repaint
|
zoom the display in or out depending on the direction of the
|
protected void fire item state changed item event e guaranteed to return a non null array object listeners listener list get listener list process the listeners last to first notifying those that are interested in this event for int i listeners length 2 i 0 i 2 if listeners i item listener class item listener listeners i 1 item state changed e
|
notifies all listeners that have registered interest for
|
protected double angle between point2 d v1 point2 d v2 double x1 v1 get x double y1 v1 get y double x2 v2 get x double y2 v2 get y cross product for direction double cross x1 y2 x2 y1 int cw 1 if cross 0 cw 1 dot product for angle double angle cw math acos x1 x2 y1 y2 math sqrt x1 x1 y1 y1 math sqrt x2 x2 y2 y2 if double is na n angle angle 0 return angle
|
returns the angle between two vectors from the origin
|
public void add action listener action listener l listener list add action listener class l fire action performed sonic classifier command bean registered
|
implements action listener
|
protected void fire change performed guaranteed to return a non null array object listeners listener list get listener list change event e null process the listeners last to first notifying those that are interested in this event for int i listeners length 2 i 0 i 2 if listeners i change listener class lazily create the event if e null e new change event this change listener listeners i 1 state changed e
|
notify all listeners that have registered interest for notification on
|
private void ensure open throws ioexception if br null throw new ioexception stream closed
|
check to make sure that the stream has not been closed
|
public void println string value print value out println out flush new line true
|
print the string as the last value on the line
|
public void println string values for string value values print value out println out flush new line true
|
print a single line of comma separated values
|
public void println string values for string value values println value if values length 0 out println out flush new line true
|
print several lines of comma separated values
|
public void println comment string comment if new line out println out print comment start out print for int i 0 i comment length i char c comment char at i switch c case r if i 1 comment length comment char at i 1 n i break intentionally excluded fall through case n out println out print comment start out print break default out print c break out println out flush new line true
|
put a comment amoung the comma separated values
|
private int check compression type string name string s int idx 1 if name null return no zip look for the last in name if idx name last index of 0 return no zip s name substring idx if s compare to gz 0 compressed with gzip s compare to z 0 compressed with gzip older version s compare to z 0 return gzip else if s compare to zip 0 return zip unknown suffix return no zip
|
check for compression check if name indicates compression i
|
public void fire selection changed int new selection logger info arrays to string new selection guaranteed to return a non null array object listeners listener list get listener list selection event e null process the listeners last to first notifying those that are interested in this event for int i listeners length 2 i 0 i 2 if listeners i selection listener class lazily create the event if e null e new selection event this new selection selection listener listeners i 1 selection changed e next i
|
notify all listeners that have registered interest for notification on
|
public void action performed action event e jcombo box cb jcombo box e get source string glyph name string cb get selected item int n sides cb get selected index plus factor update label glyph name n sides this repaint
|
listens to the combo box
|
private void fire action performed string command guaranteed to return a non null array object listeners listener list get listener list action event e null process the listeners last to first notifying those that are interested in this event for int i listeners length 2 i 0 i 2 if listeners i action listener class lazily create the event if e null e new action event this action event action performed command action listener listeners i 1 action performed e next i
|
notify all listeners that have registered interest for notification on
|
public string echo string array object string obj string strings null try strings string string obj catch class cast exception cce return class cast exception thrown cce get message string return string for string element strings return string return string element return return string
|
echo string array is useful when calling from sjava or the like
|
public void remove data set modified listener data set modified listener l listener list remove data set modified listener class l if logger is loggable level finest system out println listener list remove column appended listener class l
|
removes an column appended listener from the button
|
protected void fire data set modified object new data guaranteed to return a non null array object listeners listener list get listener list column appended event e null process the listeners last to first notifying those that are interested in this event for int i listeners length 2 i 0 i 2 if listeners i data set modified listener class lazily create the event data set modified listener listeners i 1 data set modified e
|
notify all listeners that have registered interest for notification on
|
public void fire conditioning changed if conditioning event null return guaranteed to return a non null array object listeners listener list get listener list conditioning event e null process the listeners last to first notifying those that are interested in this event for int i listeners length 2 i 0 i 2 if listeners i conditioning listener class lazily create the event if e null e new conditioning event this conditioning event get conditioning conditioning listener listeners i 1 conditioning changed e next i
|
notify all listeners that have registered interest for notification on
|
private jscroll pane get history pane if history pane null history pane new jscroll pane history pane set viewport view get history table return history pane
|
this method initializes history pane
|
private jtable get history table if history table null history table new jtable return history table
|
this method initializes history table
|
private void initialize grid bag constraints grid bag constraints new grid bag constraints grid bag constraints fill grid bag constraints both grid bag constraints gridy 0 grid bag constraints weightx 1 0 grid bag constraints weighty 1 0 grid bag constraints gridx 0 this set size 300 200 set layout new grid bag layout this add get history pane grid bag constraints
|
this method initializes this
|
public void fire selection changed if selection null return guaranteed to return a non null array object listeners listener list get listener list selection event e null process the listeners last to first notifying those that are interested in this event for int i listeners length 2 i 0 i 2 if listeners i selection listener class lazily create the event if e null e new selection event this selection selection listener listeners i 1 selection changed e next i
|
notify all listeners that have registered interest for notification on
|
public void fire subspace changed if subspace null return guaranteed to return a non null array object listeners listener list get listener list subspace event e null process the listeners last to first notifying those that are interested in this event for int i listeners length 2 i 0 i 2 if listeners i subspace listener class lazily create the event if e null e new subspace event this selection subspace listener listeners i 1 subspace changed e next i
|
notify all listeners that have registered interest for notification on
|
public void test add geo map coor bean new geo map toolkit bean bean new toolkit bean coor bean map t bean set add bean assert t bean set get bean set size 1 t bean set remove bean
|
test method for
|
public void test contains toolkit bean geo map coor bean new geo map toolkit bean bean new toolkit bean coor bean map bean set original bean coor bean t bean set add bean assert t bean set contains bean true
|
test method for
|
public void test contains jmenu item fail not yet implemented todo
|
test method for
|
public void test contains jinternal frame fail not yet implemented todo
|
test method for
|
public void test remove geo map coor bean new geo map toolkit bean bean new toolkit bean coor bean map bean set original bean coor bean t bean set add bean assert t bean set contains bean true t bean set remove bean assert t bean set contains bean false
|
test method for
|
public float get size tmnode node throws tmexception bad tmnode kind if node instanceof tmdata node tmdata node f node tmdata node node return float f node get value throw new tmexception bad tmnode kind this node
|
returns the size of the node
|
public void add child tmdata node child children put child get name child this is leaf false fah xxx is this safe if this checking thread null checking thread new checking thread checking thread start
|
add child to the node
|
protected void remove child tmdata node child children remove child get name
|
removes a child from the node
|
public double get value return this value
|
returns the size of the node
|
public enumeration children return children elements
|
returns the children of this node in an enumeration
|
public boolean is leaf return children elements has more elements return this is leaf
|
returns true if this node is not a directory
|
public void set updater tmupdater updater this updater updater
|
sets the updater for this node
|
public float get size tmnode node throws tmexception bad tmnode kind if node instanceof tmfile node tmfile node f node tmfile node node return my date f node get date throw new tmexception bad tmnode kind this node
|
returns the size of the node
|
protected void build tree progress status status if is leaf string tab fichiers file list for int i 0 i tab fichiers length i file fichier new file file get path file separator tab fichiers i tmfile node child new tmfile node fichier this status add child child
|
builds the tree hierarchie of a tmfile node
|
public enumeration children object node vector children new vector if node instanceof file file file file node if file is directory string tab fichiers file list for int i 0 i tab fichiers length i file fichier new file file get path file separator tab fichiers i children add fichier return children elements
|
returns the children of this node in an enumeration
|
protected void add child tmfile node child children put child get name child
|
add child to the node
|
public boolean is leaf object node if node instanceof file file file file node return file is directory return false
|
returns true if this node is not a directory
|
public void set updater tmmodel updater updater
|
sets the updater for this node
|
protected void remove child tmfile node child children remove child get name
|
removes a child from the node
|
public float get size tmnode node throws tmexception bad tmnode kind if node instanceof tmfile node tmfile node f node tmfile node node return f node get size throw new tmexception bad tmnode kind this node
|
returns the size of the node
|
public string get full name try return file get canonical path catch ioexception e e print stack trace return get name
|
returns the full name of the file
|
public void run try while true has changed sleep delay catch interrupted exception e
|
checks if files have changed
|
public long get size return file length
|
returns the size of the node
|
public long get date return file last modified
|
returns the last modification date
|
public boolean is leaf return file is directory
|
returns true if this node is not a directory
|
public void update observable o object arg if arg instanceof tmsvupdate tmsvupdate message tmsvupdate arg message execute this
|
called by the tmstatus view to update the view
|
public jcomponent get status view return status view get view
|
gets the status view
|
class tmsvset status implements tmsvupdate private tmstatus display status null the status to set constructor param status the new status tmsvset status tmstatus display status this status status sets the status displayed removes the old status displayed if necessary param sv the calling tmsv public void execute tmsv sv sv set status status
|
tmsvset status class implements a set status message
|
public void execute tmsv sv sv set status status
|
sets the status displayed
|
public void add algorithm tmalgorithm algorithm string name if algorithm null throw new tmexception null parameter impossible to use a null algorithm if name null throw new tmexception null parameter impossible to register an algorithm under a null name algorithm initialize root get root this store put name algorithm
|
adds a geovista
|
public void execute tmsv sv sv unset status
|
unsets the status displayed
|
public void execute tmsv sv sv increment
|
increments the status displayed
|
public void set algorithm string algo name object o store get algo name if o instanceof tmalgorithm drawer tmalgorithm o repaint
|
sets the algorithm of the geovista
|
public object get user data return user data
|
returns the user data
|
public void set user data object o user data o
|
sets the user data
|
public tmalgorithm get algorithm return drawer
|
returns the current algorithm of this view
|
private enumeration true children return children elements
|
returns the non buffered children of this node in an enumeration
|
private void add child tmnode model child children add element child dirty buf c true
|
adds the tmnode model as a children
|
public enumeration get algorithms names return store keys
|
returns the set of registered names of algorithms
|
private void remove child tmnode model child children remove element child dirty buf c true
|
removes the tmnode model as a children
|
public string to string return l1 get text progress get text l2 get text
|
returns the tmsdprogress bar in a string
|
public tmview get view tmcompute size c size tmcompute draw c draw if c size null throw new tmexception null parameter impossible to build a geovista matrix treemap tm view with a null tmcompute size else if c draw null throw new tmexception null parameter impossible to build a geovista matrix treemap tm view with a null tmcompute draw return new tmview updater c size c draw
|
returns a view of the geovista
|
public void change tmcompute size tmcompute size c size if c size is compatible with root get root get node status view set status new tmsdsimple incompatible type of tmcompute size return root launch change sizing c size
|
changes the tmcompute size object used to compute the sizings of tmnodes
|
public paint get string pattern name paint pattern paint patterns get pattern name return pattern
|
returns the pattern whose name is given in parameter
|
public enumeration get patterns names return patterns keys
|
returns an enumeration of patterns names
|
public boolean is leaf return model is leaf node
|
checks if this node is a leaf or not
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.