input
stringlengths
10
828
output
stringlengths
5
107
public void change tmcompute draw tmcompute draw c draw fah i ve never had this come out wrong and it s causing a problem if c draw is compatible with root get root get node status view set status new tmsdsimple incompatible type of tmcompute draw return root launch change drawing c draw
changes the tmcompute draw object used to compute the drawings of tmnodes
private void launch tmnode model tree building tmnode root tmthread model task new tmthread tree builder status this view root new root setter thread queue add task
launch the building of the tmnode models tree
public void set updater tmupdater updater
sets the updater for this node
private void build pattern white patterns put pattern white color white
builds and adds the pattern white in patterns
public void mouse clicked mouse event e if e is shift down view unzoom else view zoom e get x e get y
called when a user clicked on the geovista
public void draw titles boolean bool if bool true drawer draw nodes titles else drawer dont draw nodes titles repaint
sets the drawing or not of the nodes titles
private void set updater tmnode node node set updater this if node is leaf for enumeration e node children e has more elements should test here that e is not null should test here that we really have a tmnode object tmnode child node tmnode e next element set updater child node
sets the updater of the given node and of
public void update size tmnode node set changed notify observers new tmevent update size node
to be called when the user node has its size changed
private void build pattern diag1 buffered image image new buffered image 14 14 buffered image type int rgb graphics2 d g image create graphics g set color color white g fill rect 0 0 14 14 g set color color black g draw line 7 0 14 7 g draw line 0 0 14 14 g draw line 0 7 7 14 rectangle r new rectangle 0 0 14 14 paint pattern new texture paint image r patterns put pattern diag1 pattern
builds and adds the pattern diag1 in patterns
private void init ui progress new jlabel integer to string value add label add progress dimension d label label get preferred size dimension d progress progress get preferred size int width d label width 5 d progress width 10 int height math max d label height d progress height 10 set preferred size new dimension width height set size new dimension width height set maximum size new dimension width height
initialize the ui part
public void update state tmnode node set changed notify observers new tmevent update draw node
to be called when the user node has its state changed
public void add child tmnode node tmnode child set updater child set changed notify observers new tmevent update new child node child
to be called when the user node has a new child
public string to string return label get text progress get text
returns the tmsdprogress simple in a string
public void remove child tmnode node tmnode child set changed notify observers new tmevent update lost child node child
to be called when the user node removes a child
public string to string return label get text
returns the tmsdsimple in a string
public void run do it true while do it lock lock tmthread model task tmthread model queue get if task null lock unlock task run task null else do it false looping thread null lock unlock
loops on every thread in the event queue
private void build pattern diags buffered image image new buffered image 10 10 buffered image type int rgb graphics2 d g image create graphics g set color color white g fill rect 0 0 10 10 g set color color black g draw line 2 2 4 4 g draw line 7 9 9 7 rectangle r new rectangle 0 0 10 10 paint pattern new texture paint image r patterns put pattern diags pattern
builds and adds the pattern diags in patterns
public void update size object node tmnode encapsulator e node tmnode encapsulator nodes get node updater update size e node
to be called when the user node has its size changed
public void update observable o object arg if arg instanceof tmevent update tmevent update arg execute root
called when a tmupdater has its data changed
public void update state object node tmnode encapsulator e node tmnode encapsulator nodes get node updater update state e node
to be called when the user node has its state changed
private void build pattern dots buffered image image new buffered image 5 5 buffered image type int rgb graphics2 d g image create graphics g set color color white g fill rect 0 0 5 5 g set color color black g fill oval 1 1 3 3 rectangle r new rectangle 0 0 5 5 paint pattern new texture paint image r patterns put pattern dots pattern
builds and adds the pattern dots in patterns
public string get title return buf title
returns the title of the node
public void add child object node object child tmnode encapsulator e node tmnode encapsulator nodes get node tmnode encapsulator e child new tmnode encapsulator model child this e node add child e child updater add child e node e child
to be called when the user node has a new child
public object get node under the mouse mouse event event if root null return null tmnode model node m root node containing event get x event get y if node m null tmnode node node m get node if node instanceof tmnode encapsulator return tmnode encapsulator node get node return node return null
returns the node containing the mouse event
public void remove child object node object child tmnode encapsulator e node tmnode encapsulator nodes get node tmnode encapsulator e child tmnode encapsulator nodes get child e node remove child e child updater remove child e node e child
to be called when the user node removes a child
public paint get color title return buf color title
returns the color of the title of this node
private void build pattern plus buffered image image new buffered image 10 10 buffered image type int rgb graphics2 d g image create graphics g set color color white g fill rect 0 0 10 10 g set color color black g draw line 3 5 8 5 g draw line 3 6 8 6 g draw line 5 3 5 8 g draw line 6 3 6 8 rectangle r new rectangle 0 0 10 10 paint pattern new texture paint image r patterns put pattern plus pattern
builds and adds the pattern plus in patterns
private void build pattern tuiles buffered image image new buffered image 10 10 buffered image type int rgb graphics2 d g image create graphics g set color color white g fill rect 0 0 10 10 g set color color black g draw arc 5 5 10 10 0 90 g draw arc 5 5 10 10 270 90 g draw arc 0 0 10 10 0 180 rectangle r new rectangle 0 0 10 10 paint pattern new texture paint image r patterns put pattern tuiles pattern
builds and adds the pattern tuiles in patterns
public void zoom int x int y root zoom x y
zooms the geovista
private void build pattern squares buffered image image new buffered image 8 9 buffered image type int rgb graphics2 d g image create graphics g set color color white g fill rect 0 0 8 9 g set color color black g fill rect 2 2 3 3 g fill rect 5 6 3 3 rectangle r new rectangle 0 0 8 9 paint pattern new texture paint image r patterns put pattern squares pattern
builds and adds the pattern squares in patterns
public void initialize tmnode model root tmview view this root root this view view painter new tmcushion paint
initialize the algorithm
private void build pattern light gray patterns put pattern light gray color light gray
builds and adds the pattern light gray in patterns
private void build pattern dark gray patterns put pattern dark gray color dark gray
builds and adds the pattern dark gray in patterns
public void draw nodes titles set drawing titles true
draws the nodes titles
public void dont draw nodes titles set drawing titles false
dont draws the nodes titles
public void test setting of updater
tests the setting of the tmupdater in every tmnodes
public void set border size int size border size size border limit border size 2 4 view repaint set changed notify observers
sets the border size
public int get border size return border size
returns the border size
public jpanel get configuring view return new tmborder conf
returns a view for configuring this algorithm
protected short switch axis short axis axis bold as love if axis horizontal return vertical return horizontal
switch the axis and return the new axis
protected void fill node graphics2 d g tmnode model node int level rectangle area node get area warning don t use g fill shape s or g draw shape s they are really too slow g set paint node get filling g fill rect area x area y area width area height g set paint border color g draw rect area x area y area width area height if nodes titles g set paint node get color title g set font title font g draw string node get title area x 1 area y 10
fills the node
public void update observable o object arg b size set value get border size
called by the algorithm when parameters have changed
public node get from return from
returns the starting from node of this edge as node
public node get to return to
returns the terminating to node of this edge as node
public int node num return visible locality node num
returns the current node count within the visible locality
public node add node string label throws tgexception string id if find node label null id label else int i for i 1 find node label i null i id label i if label is a valid xml name then so is id return add node id label
adds a node provided its label
public void add node to elt set node node throws tgexception visible locality get complete elt set add node node reset damper
add the node tt node tt to the complete elt set
public void add node final node node throws tgexception visible locality add node node reset damper
add the node tt node tt to the visible locality checking for id
public boolean delete node by id string id if id null return false ignore node node find node id if node null return false return delete node node
remove the node object matching the id code id code returning true if
private void select button action performed action event e logger finest select button pressed in action performed int plot number plotted attributes length logger finest select button pressed plot number plot number init process selected variables
selection button in variable selection dialog
public collection find nodes by label string label vector nodelist new vector for int i 0 i node num i if node at i null node at i get label equals label nodelist add node at i if nodelist size 0 return null return nodelist
return a collection of all nodes whose label matches the string
public edge find edge node from node to for int i 0 i from edge num i edge e from edge at i if e to to return e return null
return an edge spanning node tt from tt to node tt to tt
public boolean delete edge edge edge if edge null return false if edges remove element edge return false edge from remove edge edge edge to remove edge edge return true
delete the edge tt edge tt
public boolean delete edge node from node to edge e find edge from to if e null return delete edge e return false
delete the edge spanning node tt from tt to node tt to tt
public node get random node if nodes size 0 return null int r int math random node num return node at r
returns a random node or null if none exist for making random graphs
public node get first node if nodes size 0 return null return node at 0
return the first node null if none exist
public void select first node set select get ges get first node
a convenience method that selects the first node of a graph so that
public void add indication listener indication listener l tg panel add indication listener l
adds an indication listener
public void remove indication listener indication listener l tg panel remove indication listener l
removes an indication listener from the component
public void add selection listener selection listener l tg panel add selection listener l
adds an selection listener
public void remove selection listener selection listener l tg panel remove selection listener l
removes an selection listener from the component
public void set location point p x p x y p y
set the location of this node provided the point tt p tt
public void start damper tg layout start damper
start and stop the damper
public void reset damper tg layout reset damper
makes the graph mobile and slowly slows it down
public void set label string label lbl label
set the label of this node to the string tt label tt
public int local edge num return local edge count
returns the local edge count
public int get width if font metrics null lbl null return font metrics string width lbl 12 return 10
return the width of this node
public int get height if font metrics null return font metrics get height 6 return 6
return the height of this node
public void paint graphics g tgpanel tg panel if intersects tg panel get size return paint node body g tg panel if local edge num edge num int ix int drawx int iy int drawy int h get height int w get width int tag x ix w 7 2 2 w 2 int tag y iy h 2 2 char character int hidden edge num edge num local edge num character hidden edge num 9 char 0 hidden edge num paint small tag g tg panel tag x tag y color red color white character
paints the node
public void set geometry geometry g geometry geometry g clone
sets the geometry contained in this lite shape
public void set max distance double distance max distance distance
sets the distance limit for point skipping during distance based
public boolean contains rectangle2 d r geometry rect rectangle to geometry r return geometry contains rect
tests if the interior of the code shape code entirely contains the
public double get max distance return max distance
returns the distance limit for point skipping during distance based
public int current segment double coords first make sure we re not at the last element this prevents us from exceptions in the case where coords size 0 if current coord this coords size return seg close else if current coord 0 coords 0 this coords get x 0 coords 1 this coords get y 0 transform coords 0 coords 0 1 return seg moveto else coords 0 this coords get x current coord coords 1 this coords get y current coord transform coords 0 coords 0 1 return seg lineto
returns the coordinates and type of the current path segment in the
public boolean contains point2 d p coordinate coord new coordinate p get x p get y geometry point geometry get factory create point coord return geometry contains point
tests if a specified
public void set max distance float distance max distance distance
sets the distance limit for point skipping during distance based
public boolean contains double x double y coordinate coord new coordinate x y geometry point geometry get factory create point coord return geometry contains point
tests if the specified coordinates are inside the boundary of the
public boolean contains double x double y double w double h geometry rect create rectangle x y w h return geometry contains rect
tests if the interior of the code shape code entirely contains the
public int current segment double coords return current iterator current segment coords
returns the coordinates and type of the current path segment in the
public boolean contains point2 d arg0 return false
always returns false
public boolean contains rectangle2 d arg0 todo auto generated method stub return false
always returns false
public boolean contains double arg0 double arg1 todo auto generated method stub return false
always returns false
public boolean contains double arg0 double arg1 double arg2 double arg3 todo auto generated method stub return false
always returns false
public rectangle get bounds return er
returns an empty rectangle
public rectangle2 d get bounds2 d envelope env geometry get envelope internal return new rectangle2 d double env get min x env get min y env get width env get height
returns a high precision and more accurate bounding box of the
public path iterator get path iterator affine transform arg0 todo auto generated method stub return ei
returns an empty affine transform
public path iterator get path iterator affine transform arg0 double arg1 todo auto generated method stub return ei
returns an empty path iterator
public boolean intersects rectangle2 d arg0 todo auto generated method stub return false
always returns false
public void next if current iterator is done if current geom gc get num geometries 1 current geom current iterator get iterator gc get geometry n current geom else done true else current iterator next
moves the iterator to the next segment of the path forwards along the
public boolean intersects double arg0 double arg1 double arg2 double arg3 todo auto generated method stub return false
always returns false
public boolean intersects rectangle2 d r geometry rect rectangle to geometry r return geometry intersects rect
tests if the interior of the code shape code intersects the interior
public boolean intersects double x double y double w double h geometry rect create rectangle x y w h return geometry intersects rect
tests if the interior of the code shape code intersects the interior
public void fire selection changed int 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
private geometry rectangle to geometry rectangle2 d r return create rectangle r get min x r get min y r get width r get height
converts the rectangle2 d passed as parameter in a jts geometry object
private geometry create rectangle double x double y double w double h coordinate coords new coordinate x y new coordinate x y h new coordinate x w y h new coordinate x w y new coordinate x y linear ring lr geometry get factory create linear ring coords return geometry get factory create polygon lr null
creates a jts geometry object representing a rectangle with the given
public affine transform get affine transform return affine transform
returns the affine transform for this lite shape
public void insert item mstedge item que add item
inserts an edge into the que
public int get num of elements return capacity
get the num of elements in the que
public mstedge remove min mstedge temp new mstedge int index 0 for int i 0 i que size i mstedge tmp1 mstedge que element at i if temp get weight tmp1 get weight temp tmp1 index i que remove element at index capacity que size return temp
removes the element with the lowest priority from the que
public string to string resource bundle res string return string res get string start start res get string end end res get string weight weight return return string
print the edge