input
stringlengths
10
828
output
stringlengths
5
107
public string to string return string value of this value
returns a code string code object representing this code
public void clear min node null n nodes 0
removes all elements from this heap
public void delete fibonacci heap node t x make x as small as possible decrease key x double negative infinity remove the smallest which decreases n also remove min
deletes a node from the heap given the reference to the node
public void insert fibonacci heap node t node double key node key key concatenate node into min list if min node null node left min node node right min node right min node right node node right left node if key min node key min node node else min node node n nodes
inserts a new data element into the heap
protected void cascading cut fibonacci heap node t y fibonacci heap node t z y parent if there s a parent if z null if y is unmarked set it marked if y mark y mark true else it s marked cut it from parent cut y z cut its parent as well cascading cut z
performs a cascading cut operation
private void internal remove cell graph cell cell j cells being removed add cell remove new object cell j cells being removed remove cell
removed the specified cell from the jgraph graph model
protected void link fibonacci heap node t y fibonacci heap node t x remove y from root list of heap y left right y right y right left y left make y a child of x y parent x if x child null x child y y right y y left y else y left x child y right x child right x child right y y right left y increase degree x x degree set mark y false y mark false
make node y a child of node x
public boolean add vertex v v if v null throw new null pointer exception if base contains vertex v throw new illegal argument exception no such vertex in base if contains vertex v return false else vertex set add v return true
adds the specified vertex to this subgraph
public string to string return to string from sets vertex set edge set this instanceof directed graph
returns a string of the parenthesized pair v e representing this
protected boolean assert vertex exist v v if contains vertex v return true else if v null throw new null pointer exception else throw new illegal argument exception no such vertex in graph
ensures that the specified vertex exists in this graph or else throws
protected boolean remove all edges e edges boolean modified false for int i 0 i edges length i modified remove edge edges i return modified
removes all the edges in this graph that are also contained in the
public boolean is allowing multiple edges return allowing multiple edges
returns code true code if and only if multiple edges are allowed in
protected void fire edge added e edge graph edge change event v e e create graph edge change event graph edge change event edge added edge for int i 0 i graph listeners size i graph listener v e l graph listeners get i l edge added e
notify listeners that the specified edge was added
protected void fire edge removed e edge graph edge change event v e e create graph edge change event graph edge change event edge removed edge for int i 0 i graph listeners size i graph listener v e l graph listeners get i l edge removed e
notify listeners that the specified edge was removed
protected void fire vertex added v vertex graph vertex change event v e create graph vertex change event graph vertex change event vertex added vertex for int i 0 i vertex set listeners size i vertex set listener v l vertex set listeners get i l vertex added e for int i 0 i graph listeners size i graph listener v e l graph listeners get i l vertex added e
notify listeners that the specified vertex was added
protected void fire vertex removed v vertex graph vertex change event v e create graph vertex change event graph vertex change event vertex removed vertex for int i 0 i vertex set listeners size i vertex set listener v l vertex set listeners get i l vertex removed e for int i 0 i graph listeners size i graph listener v e l graph listeners get i l vertex removed e
notify listeners that the specified vertex was removed
public boolean is auto resize graph return auto resize graph
returns true if the graph should be automatically resized when cells are
public point2 d get center point if get parent instanceof jviewport rectangle view jviewport get parent get view rect return new point2 d double view get center x view get center y rectangle view get bounds return new point2 d double view get center x view get center y
returns the center of the component relative to the parent viewports
public graphics get offgraphics rectangle rect get bounds if offscreen null offgraphics null offscreen instanceof buffered image buffered image offscreen get width rect width buffered image offscreen get height rect height offscreen new buffered image rect width rect height buffered image type int rgb offgraphics offscreen get graphics offgraphics set clip 0 0 rect width rect height return offgraphics
returns the current double buffering graphics object
private void set attribute cell view view string key object obj if view get attributes null view change attributes new attribute map map attributes view get attributes attributes put key obj
sets an attribute in a cell view
protected void configure try layout controller controller jgraph layout algorithm controller jgraph layout algorithm lst layout controllers get selected value jdialog dialog get layout settings dialog controller dialog set visible true catch exception e e print stack trace
will call if the user clicks on the gp configuration button
public boolean get vertical direction return vertical direction check box is selected
returns the value of the vertical direction check box
public void set vertical direction boolean vertical vertical direction check box set selected vertical
sets the value of the vertical direction check box
protected void mark selected cell view selected cell views boolean add mark if add mark for int i 0 i selected cell views length i if selected cell views i null selected cell views i get attributes put sugiyama selected boolean true else for int i 0 i selected cell views length i if selected cell views i null selected cell views i get attributes remove sugiyama selected
adds an attribute
protected boolean is selected final graph layout cache cache final object cell final cell view view cache get mapping cell false return view null view get attributes get sugiyama selected null
detects whether the specified cell has been marked selected
private void initialize this set text select color this add get jmenu item add color selection items add select foreground menu
this method initializes this
private void initialize this add get copy item this add get cut item this add get paste item this add get jseparator this add get delete item this add get jseparator1 this add get shape selection menu this add get jseparator2 this add get selected vertex color menu this add get jseparator31 this add get jmenu item this add get jseparator3 this add get operations menu this add get jseparator4 this add get insert mode item
this method initializes this
private jmenu item get copy item if copy item null copy item new jmenu item copy item set text copy copy item add action listener new java awt event action listener public void action performed java awt event action event e graph pane copy e return copy item
this method initializes copy item
private jmenu item get cut item if cut item null cut item new jmenu item cut item set text cut cut item add action listener new java awt event action listener public void action performed java awt event action event e graph pane cut e return cut item
this method initializes cut item
private jmenu item get paste item if paste item null paste item new jmenu item paste item set text paste paste item add action listener new java awt event action listener public void action performed java awt event action event e graph pane paste e return paste item
this method initializes paste item
private jmenu item get delete item if delete item null delete item new jmenu item delete item set text delete delete item add action listener new java awt event action listener public void action performed java awt event action event e graph pane remove selected return delete item
this method initializes delete item
private jcheck box menu item get insert mode item if insert mode item null insert mode item new jcheck box menu item insert mode item set text insert mode insert mode item add item listener new java awt event item listener public void item state changed java awt event item event e graph pane set insert mode jcheck box menu item e get source is selected insert mode item set selected true return insert mode item
this method initializes insert mode item
private shape selection menu get shape selection menu if shape selection menu null shape selection menu new shape selection menu graph pane return shape selection menu
this method initializes shape selection menu
private selected vertex color menu get selected vertex color menu if selected vertex color menu null selected vertex color menu new selected vertex color menu graph pane return selected vertex color menu
this method initializes selected vertex color menu
private jseparator get jseparator31 if j separator31 null j separator31 new jseparator return j separator31
this method initializes j separator31
private jmenu item get jmenu item if j menu item null j menu item new jmenu item subdivide edge s j menu item add action listener new java awt event action listener public void action performed java awt event action event e split selected edges dialog show graph pane return j menu item
this method initializes j menu item
private jseparator get jseparator4 if j separator4 null j separator4 new jseparator return j separator4
this method initializes j separator4
private operations menu get operations menu if operations menu null operations menu new operations menu graph pane return operations menu
this method initializes operations menu
private void initialize this add get paste menu item this add get jseparator1 this add get delete item this add get jseparator2 this add get jmenu item this add get jseparator this add get insert mode item
this method initializes this
private jmenu item get jmenu item if j menu item null j menu item new jmenu item j menu item set text subdivide edge s j menu item add action listener new java awt event action listener public void action performed java awt event action event e split selected edges dialog show graph pane return j menu item
this method initializes j menu item
private void initialize this set text selection this set mnemonic key event vk s this add get select all selection menu item this add get select neighbour selection menu item this add get jmenu item this add get select other selection menu item
this method initializes this
private jmenu item get select all selection menu item if select all selection menu item null select all selection menu item new jmenu item select all selection menu item set text select all select all selection menu item add action listener new java awt event action listener public void action performed java awt event action event e graph pane select all return select all selection menu item
this method initializes select all selection menu item
private jmenu item get select neighbour selection menu item if select neighbour selection menu item null select neighbour selection menu item new jmenu item select neighbour selection menu item set text select neighbour select neighbour selection menu item add action listener new java awt event action listener public void action performed java awt event action event e graph pane select neighbour return select neighbour selection menu item
this method initializes select neighbour selection menu item
private jmenu item get select other selection menu item if select other selection menu item null select other selection menu item new jmenu item select other selection menu item set text select complement select other selection menu item add action listener new java awt event action listener public void action performed java awt event action event e graph pane select other return select other selection menu item
this method initializes select other selection menu item
private jmenu item get jmenu item if j menu item null j menu item new jmenu item j menu item set text select reachable j menu item add action listener new java awt event action listener public void action performed java awt event action event e graph pane select reachable return j menu item
this method initializes j menu item
private jmenu item get complete bipartite graph menu item if complete bipartite graph menu item null complete bipartite graph menu item new jmenu item complete bipartite graph complete bipartite graph menu item add action listener new java awt event action listener public void action performed java awt event action event e if graph pane is ready for operation graph pane do complete bipartite graph operation else joption pane show message dialog get root pane graph pane not ready for operation n an operation is pending can not perform operation joption pane information message return complete bipartite graph menu item
this method initializes complete bipartite graph menu item
private jmenu item get jmenu item if j menu item null j menu item new jmenu item graph cartesian product j menu item add action listener new java awt event action listener public void action performed java awt event action event e if graph pane is ready for operation graph pane do graph cartesian product operation else joption pane show message dialog get root pane graph pane not ready for operation n an operation is pending can not perform operation joption pane information message return j menu item
this method initializes j menu item
private jmenu item get jmenu item1 if j menu item1 null j menu item1 new jmenu item graph catergorial product j menu item1 add action listener new java awt event action listener public void action performed java awt event action event e if graph pane is ready for operation graph pane do graph catergorial product operation else joption pane show message dialog get root pane graph pane not ready for operation n an operation is pending can not perform operation joption pane information message return j menu item1
this method initializes j menu item1
public void select all object cells graph pane get graph layout cache get cells false true false true graph pane set selection cells cells
selects all vertices and edges in the graph
private jmenu item get jmenu item2 if j menu item2 null j menu item2 new jmenu item j menu item2 set text make selected subgraph complete j menu item2 add action listener new java awt event action listener public void action performed java awt event action event e if graph pane is ready for operation graph pane make subgraph complete operation else joption pane show message dialog get root pane graph pane not ready for operation n an operation is pending can not perform operation joption pane information message return j menu item2
this method initializes j menu item2
public void select neighbour object cells graph pane get selection cells graph pane get graph layout cache get cells false true false false list object all selections new linked list object for object c cells all selections add c list object neighbours graph pane get graph layout cache get neighbours c null false true all selections add all neighbours graph pane set selection cells all selections to array
selects all neighour vertices of selected verices
private jmenu item get jmenu item3 if j menu item3 null j menu item3 new jmenu item j menu item3 set text calculate graph statistics j menu item3 add action listener new java awt event action listener public void action performed java awt event action event e graph statistics dialog show graph pane return j menu item3
this method initializes j menu item3
public void select other object selected cells graph pane get selection cells graph pane get graph layout cache get cells false true false false hash set object all cells set new hash set object object all cells graph pane get graph layout cache get cells false true false false for object c all cells all cells set add c for object c selected cells all cells set remove c graph pane set selection cells all cells set to array
select the compliment of selected verices and deselect all previus
private jmenu item get jmenu item4 if j menu item4 null j menu item4 new jmenu item j menu item4 set text mirror selected vertices horizontal j menu item4 add action listener new java awt event action listener public void action performed java awt event action event e graph pane mirror selected vertices horizontal return j menu item4
this method initializes j menu item4
private void initialize this set text select shape
this method initializes this
private jmenu item get jmenu item5 if j menu item5 null j menu item5 new jmenu item j menu item5 set text mirror selected vertices vertical j menu item5 add action listener new java awt event action listener public void action performed java awt event action event e graph pane mirror selected vertices vertical return j menu item5
this method initializes j menu item5
private void initialize this add get paste item this add get jseparator this add get insert vertex item this add get jseparator2 this add get operations menu this add get jseparator1 this add get insert mode item
this method initializes this
private jmenu item get insert vertex item if insert vertex item null insert vertex item new jmenu item insert vertex item set text insert vertex insert vertex item add action listener new java awt event action listener public void action performed java awt event action event e graph pane add default vertex at graph xpos graph ypos return insert vertex item
this method initializes insert vertex item
private jmenu item get jmenu item6 if j menu item6 null j menu item6 new jmenu item j menu item6 set text place selected vertices in circle j menu item6 add action listener new java awt event action listener public void action performed java awt event action event e graph pane place selected vertices in circle return j menu item6
this method initializes j menu item6
private jpanel get jpanel if j panel null j label new jlabel j label set text select an expand factor j panel new jpanel j panel set layout new border layout j panel add j label border layout north return j panel
this method initializes j panel
private jpanel get jpanel1 if j panel1 null j panel1 new jpanel j panel1 set layout new border layout j panel1 add get jspinner border layout north j panel1 add get jpanel2 border layout south return j panel1
this method initializes j panel1
private jspinner get jspinner if j spinner null spinner model model new spinner number model 1 0 initial value 0 min 1000 max 0 1 step j spinner new jspinner model return j spinner
this method initializes j spinner
private jpanel get jpanel2 if j panel2 null j panel2 new jpanel j panel2 set layout new box layout get jpanel2 box layout x axis j panel2 set border border factory create bevel border bevel border raised j panel2 add box create glue j panel2 add get jbutton1 null j panel2 add get jbutton null return j panel2
this method initializes j panel2
private jbutton get jbutton if j button null j button new jbutton j button set text expand j button add action listener new java awt event action listener public void action performed java awt event action event e graph pane expand by factor double j spinner get value return j button
this method initializes j button
private jmenu item get jmenu item7 if j menu item7 null j menu item7 new jmenu item j menu item7 set text rotate selected vertices j menu item7 add action listener new java awt event action listener public void action performed java awt event action event e graph pane rotate selected vertices return j menu item7
this method initializes j menu item7
private jbutton get jbutton1 if j button1 null j button1 new jbutton j button1 set text cancel j button1 add action listener new java awt event action listener public void action performed java awt event action event e set visible false dispose return j button1
this method initializes j button1
private jmenu item get jmenu item8 if j menu item8 null j menu item8 new jmenu item j menu item8 set text apply graph loyout algorithm j menu item8 add action listener new action listener public void action performed action event e new layout dialog graph pane get main frame graph pane set visible true return j menu item8
this method initializes j menu item8
private void position vertex at vertex information vertex double x double y default graph cell cell jg adapter get vertex cell vertex attribute map attr cell get attributes rectangle2 d new bounds new rectangle2 d double x y 18 18 graph constants set bounds attr new bounds attribute map cell attr new attribute map cell attr put cell attr jg adapter edit cell attr null null null
the method sets the position on a vertex
private jmenu item get jmenu item9 if j menu item9 null j menu item9 new jmenu item j menu item9 set text expand selected by factor j menu item9 add action listener new java awt event action listener public void action performed java awt event action event e expand dialog show expand dialog graph pane return j menu item9
this method initializes j menu item9
private jpanel get jpanel if j panel null j panel new jpanel j panel set layout new border layout j panel add get jpanel5 border layout north j panel add get jpanel2 border layout south return j panel
this method initializes j panel
private jpanel get jpanel1 if j panel1 null j panel1 new jpanel j panel1 set layout new box layout get jpanel1 box layout y axis j panel1 add get jpanel3 null j panel1 add get jpanel4 null j panel1 add get jpanel6 null j panel1 add box create glue return j panel1
this method initializes j panel1
private jpanel get jpanel2 if j panel2 null j panel2 new jpanel j panel2 set layout new box layout get jpanel2 box layout x axis j panel2 add box create glue j panel2 add get jbutton null j panel2 add get jbutton1 null return j panel2
this method initializes j panel2
private jbutton get jbutton if j button null j button new jbutton j button set text cancel j button add action listener new java awt event action listener public void action performed java awt event action event e set visible false dispose parent set enabled true return j button
this method initializes j button
private jpanel get jpanel3 if j panel3 null j label new jlabel j label set text max 1000 j panel3 new jpanel j panel3 set layout new box layout get jpanel3 box layout x axis j panel3 set border border factory create titled border null number of vertices titled border default justification titled border default position null null j panel3 add get vertex spinner null j panel3 add box create glue j panel3 add j label null return j panel3
this method initializes j panel3
private jpanel get jpanel4 if j panel4 null edge information label new jlabel edge information label set text max 45 j panel4 new jpanel j panel4 set layout new box layout get jpanel4 box layout x axis j panel4 set border border factory create titled border null number of edges titled border default justification titled border default position null null j panel4 add get edge spinner null j panel4 add box create glue j panel4 add edge information label null return j panel4
this method initializes j panel4
private jspinner get edge spinner if edge spinner null spinner model model new spinner number model 45 initial value 0 min 45 max 1 step edge spinner new jspinner model return edge spinner
this method initializes edge spinner
private jpanel get jpanel5 if j panel5 null j panel5 new jpanel j panel5 set layout new border layout j panel5 add get jpanel1 border layout north return j panel5
this method initializes j panel5
private jpanel get jpanel6 if j panel6 null distance label new jlabel distance label set text 45 pixels j panel6 new jpanel j panel6 set layout new box layout get jpanel6 box layout x axis j panel6 set border border factory create titled border null approximate distance between vertices in pixels titled border default justification titled border default position new font dialog font bold 12 new color 51 51 51 j panel6 add get jslider null j panel6 add distance label null return j panel6
this method initializes j panel6
public void remove selected if is selection empty object cells get selection cells cells get descendants cells get graph layout cache remove cells
if vertices is selected then remove all selected verteces and edges and
public object clone edge information clone edge new edge information clone edge set source vertex id source vertex id clone edge set target vertex id target vertex id return clone edge
make a copy of this edge
private void initialize this set title split edge s this set size new dimension 320 170 this set content pane get jpanel1
this method initializes this
private void initialize this set title rotate this set size new dimension 270 100 this set content pane get jpanel this add window listener new java awt event window adapter public void window closing java awt event window event e parent set enabled true
this method initializes this
private jpanel get jpanel if j panel null grid bag constraints grid bag constraints new grid bag constraints grid bag constraints gridx 0 grid bag constraints gridy 0 j panel new jpanel j panel set layout new grid bag layout j panel set border border factory create titled border null select number of vertices to put in titled border default justification titled border default position null null j panel add get jspinner grid bag constraints return j panel
this method initializes j panel
private jspinner get jspinner if j spinner null spinner model model new spinner number model 1 initial value 1 min 100 max 1 step j spinner new jspinner model return j spinner
this method initializes j spinner
private jpanel get jpanel1 if j panel1 null j panel1 new jpanel j panel1 set layout new border layout j panel1 add get jpanel border layout north j panel1 add get jpanel2 border layout south return j panel1
this method initializes j panel1
private jpanel get jpanel if j panel null j panel new jpanel j panel set layout new border layout j panel add get jpanel2 border layout center j panel add get jpanel1 border layout south return j panel
this method initializes j panel
private jbutton get jbutton if j button null j button new jbutton j button set text ok j button add action listener new java awt event action listener public void action performed java awt event action event e shall split all selected edges graph pane split selected edges integer j spinner get value set visible false dispose return j button
this method initializes j button
private jpanel get jpanel1 if j panel1 null j panel1 new jpanel j panel1 set layout new box layout get jpanel1 box layout x axis j panel1 set border border factory create bevel border bevel border raised j panel1 add box create glue j panel1 add get jbutton null j panel1 add get jbutton1 null return j panel1
this method initializes j panel1
private jbutton get jbutton1 if j button1 null j button1 new jbutton j button1 set text cancel return j button1
this method initializes j button1
private jbutton get jbutton if j button null j button new jbutton j button set text cancel j button add action listener new java awt event action listener public void action performed java awt event action event e set visible false graph pane ignore undoable on next edit graph pane get graph layout cache edit orginal bounds map parent set enabled true dispose return j button
this method initializes j button
private jbutton get jbutton1 if j button1 null j button1 new jbutton j button1 set text ok j button1 add action listener new java awt event action listener public void action performed java awt event action event e set visible false graph pane ignore undoable on next edit graph pane get graph layout cache edit orginal bounds map graph pane get graph layout cache edit current change map parent set enabled true dispose return j button1
this method initializes j button1
private jpanel get jpanel2 if j panel2 null j panel2 new jpanel j panel2 set layout new box layout get jpanel2 box layout y axis j panel2 set border border factory create titled border null select rotation angle titled border default justification titled border default position null null j panel2 add get jslider null j panel2 add get jpanel3 null j panel2 add box create glue return j panel2
this method initializes j panel2
private jslider get jslider if j slider null j slider new jslider j slider set minimum 360 j slider set minor tick spacing 0 j slider set maximum 360 j slider add change listener new change listener public void state changed change event e j spinner set value j slider get value 0 0 j slider get value rotation changed j slider get value 0 0 j slider get value return j slider
this method initializes j slider
private jspinner get jspinner if j spinner null j spinner new jspinner spinner number model model new spinner number model 0 360 360 1 j spinner set model model j spinner set preferred size new dimension 70 20 j spinner add change listener new change listener public void state changed change event e if j spinner get value instanceof integer double value integer j spinner get value long round value math round value int use value new long round value int value j slider set value use value return j spinner
this method initializes j spinner
private jpanel get jpanel3 if j panel3 null j panel3 new jpanel j panel3 set layout new flow layout j panel3 add get jspinner null return j panel3
this method initializes j panel3
public boolean is changed if its posible to undo then the graph is changed return undo manager can undo
return true if the current graph has been changed
private jtext area get jtext area if j text area null j text area new jtext area j text area set editable false j text area set wrap style word true j text area set line wrap true return j text area
this method initializes j text area
private jpanel get jpanel if j panel null j label new jlabel j label set text j panel new jpanel j panel set layout new border layout j panel set border border factory create bevel border bevel border lowered j panel add j label border layout center j panel add get jpanel1 border layout south return j panel
this method initializes j panel
private jbutton get jbutton if j button null j button new jbutton j button set text cancel process j button add action listener new java awt event action listener public void action performed java awt event action event e running process interrupt set visible false parent set enabled true dispose return j button
this method initializes j button
public void zoom in double scale get scale 1 0 global properties scale intervall this set scale scale graph properties set zoom level scale graph properties fire changed event
zoom in the graph the amunt that is specified in the