input
stringlengths
10
828
output
stringlengths
5
107
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 add box create glue j panel1 add get jbutton null return j panel1
this method initializes j panel1
public void zoom out 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 out the graph the amunt that is specified in the
private void initialize this set text edit this set mnemonic key event vk e this set action command this add get undo edit menu item this add get redo edit menu item this add get jseparator this add get cut edit menu item this add get copy edit menu item this add get paste edit menu item this add get jseparator1 this add get insert mode edit check box menu item
this method initializes this
private jmenu item get undo edit menu item if undo edit menu item null undo edit menu item new jmenu item undo edit menu item set text undo undo edit menu item set icon new image icon get class get resource org grapheditor gui icons 16x16 undo png undo action new java awt event action listener public void action performed java awt event action event e graph pane undo undo edit menu item add action listener undo action return undo edit menu item
this method initializes undo edit menu item
public void set default zoom level if get scale 1 0 double scale 1 0 this set scale scale graph properties set zoom level scale graph properties fire changed event
sets to default zoom level
private jmenu item get redo edit menu item if redo edit menu item null redo edit menu item new jmenu item redo edit menu item set text redo redo edit menu item set icon new image icon get class get resource org grapheditor gui icons 16x16 redo png redo action new java awt event action listener public void action performed java awt event action event e graph pane redo redo edit menu item add action listener redo action return redo edit menu item
this method initializes redo edit menu item
private void initialize this set text file this set mnemonic key event vk f this add get new file menu item this add get jseparator this add get open file menu item this add get open latest file menu this add get jseparator1 this add get save file menu item this add get save as file menu item this add get jseparator2 this add get export to file menu this add get import from file menu this add get jseparator3 this add get exit file menu item
this method initializes this
private jmenu item get cut edit menu item if cut edit menu item null cut edit menu item new jmenu item cut edit menu item set text cut cut edit menu item set icon new image icon get class get resource org grapheditor gui icons 16x16 editcut png cut action new java awt event action listener public void action performed java awt event action event e graph pane cut e cut edit menu item add action listener cut action return cut edit menu item
this method initializes cut edit menu item
private jmenu item get copy edit menu item if copy edit menu item null copy edit menu item new jmenu item copy edit menu item set text copy copy edit menu item set icon new image icon get class get resource org grapheditor gui icons 16x16 editcopy png copy action new java awt event action listener public void action performed java awt event action event e graph pane copy e copy edit menu item add action listener copy action return copy edit menu item
this method initializes copy edit menu item
private jmenu item get paste edit menu item if paste edit menu item null paste edit menu item new jmenu item paste edit menu item set text paste paste edit menu item set icon new image icon get class get resource org grapheditor gui icons 16x16 editpaste png paste action new java awt event action listener public void action performed java awt event action event e graph pane paste e paste edit menu item add action listener paste action return paste edit menu item
this method initializes paste edit menu item
public void set graph properties graph properties graph properties this graph properties graph properties for graph properties change listener l graph properties change listeners l graph properties changed
sets the graph properties to another
private void initialize this set text view this set mnemonic key event vk v this add get zoom in view menu item this add get zoom out view menu item this add get default zoom menu item this add get jseparator this add get center view menu item
this method initializes this
private jmenu item get zoom in view menu item if zoom in view menu item null zoom in view menu item new jmenu item zoom in view menu item set text zoom in zoom in view menu item set icon new image icon get class get resource org grapheditor gui icons 16x16 viewmag png zoom in action new java awt event action listener public void action performed java awt event action event e graph pane zoom in zoom in view menu item add action listener zoom in action return zoom in view menu item
this method initializes zoom in view menu item
private jmenu item get zoom out view menu item if zoom out view menu item null zoom out view menu item new jmenu item zoom out view menu item set text zoom out zoom out view menu item set icon new image icon get class get resource org grapheditor gui icons 16x16 viewmag png zoom out action new java awt event action listener public void action performed java awt event action event e graph pane zoom out zoom out view menu item add action listener zoom out action return zoom out view menu item
this method initializes zoom out view menu item
private jmenu item get open file menu item if open file menu item null open file menu item new jmenu item open file menu item set text open open file menu item set icon new image icon get class get resource org grapheditor gui icons 16x16 fileopen png open action new java awt event action listener public void action performed java awt event action event e open open file menu item add action listener open action return open file menu item
this method initializes open file menu item
private jmenu item get default zoom menu item if default zoom menu item null default zoom menu item new jmenu item default zoom menu item set text default default zoom menu item set icon new image icon get class get resource org grapheditor gui icons 16x16 viewmag1 png default zomm level action new java awt event action listener public void action performed java awt event action event e graph pane set default zoom level default zoom menu item add action listener default zomm level action return default zoom menu item
this method initializes default zoom menu item
private void initialize this set text help this add get help help menu item this add get about help menu item
this method initializes this
private jmenu item get help help menu item if help help menu item null help help menu item new jmenu item help help menu item set text help help help menu item add action listener new java awt event action listener public void action performed java awt event action event e global properties get instance get help broker set displayed true global properties get instance get help broker set current id introduction return help help menu item
this method initializes help help menu item
private jmenu item get about help menu item if about help menu item null about help menu item new jmenu item about help menu item set text about about help menu item add action listener new java awt event action listener public void action performed java awt event action event e about dialog show about dialog main frame return about help menu item
this method initializes about help menu item
private void initialize this set text properties this set mnemonic key event vk p this add get show quick menus properites menu this add get jseparator this add get graph properties menu item this add get jseparator1 this add get properties menu item
this method initializes this
private jmenu get show quick menus properites menu if show quick menus properites menu null show quick menus properites menu new jmenu show quick menus properites menu set text show quickmenus return show quick menus properites menu
this method initializes show quick menus properites menu
private void open open a save file chooser so the user can choose a file name to save to int return val get open file chooser show open dialog get root pane file selected file null if return val jfile chooser approve option selected file get open file chooser get selected file if graph pane is changed main window open window with file selected file return open file selected file
open a file chooser to choose a file to open
private jmenu item get graph properties menu item if graph properties menu item null graph properties menu item new jmenu item graph properties menu item set text graph properties graph properties menu item add action listener new java awt event action listener public void action performed java awt event action event e new graph properties dialog parent frame graph pane set visible true return graph properties menu item
this method initializes graph properties menu item
protected default graph cell get source default edge edge object port edge get target if port instanceof default port default port port ins default port port if port ins get root instanceof default graph cell default graph cell dest vertex default graph cell port ins get root return dest vertex return null
returns the graph cell that is the source of the edge specified as
private jmenu item get properties menu item if properties menu item null properties menu item new jmenu item properties menu item set text properties properties menu item add action listener new java awt event action listener public void action performed java awt event action event e new global properties dialog parent frame graph pane set visible true return properties menu item
this method initializes properties menu item
private void initialize this set name edit quickmenu this add get undo button this add get redo button this add get copy button this add get cut button this add get paste button
this method initializes this
synchronized public boolean is ready for operation return graph operation helper is ready for operation
this returns false if an operation is pending so it isnt posible to
private jbutton get undo button if undo button null undo button new jbutton undo button set icon new image icon get class get resource org grapheditor gui icons 16x16 undo png undo button add action listener edit menu get undo action return undo button
this method initializes undo button
private jbutton get redo button if redo button null redo button new jbutton redo button set icon new image icon get class get resource org grapheditor gui icons 16x16 redo png redo button add action listener edit menu get redo action return redo button
this method initializes redo button
private jbutton get copy button if copy button null copy button new jbutton copy button set icon new image icon get class get resource org grapheditor gui icons 16x16 editcopy png copy button add action listener edit menu get copy action return copy button
this method initializes copy button
private jmenu get open latest file menu if open latest file menu null open latest file menu new jmenu open latest file menu set text open latest open latest file menu set icon new image icon get class get resource org grapheditor gui icons 16x16 fileopen png return open latest file menu
this method initializes open latest file menu
private jbutton get cut button if cut button null cut button new jbutton cut button set icon new image icon get class get resource org grapheditor gui icons 16x16 editcut png cut button add action listener edit menu get cut action return cut button
this method initializes cut button
private jbutton get paste button if paste button null paste button new jbutton paste button set icon new image icon get class get resource org grapheditor gui icons 16x16 editpaste png paste button set name edit quickmenu paste button add action listener edit menu get paste action return paste button
this method initializes paste button
private void initialize this set name file quickmenu this add get new graph button this add get save button this add get save graph button
this method initializes this
private jbutton get new graph button if new graph button null new graph button new jbutton new graph button set icon new image icon get class get resource org grapheditor gui icons 16x16 filenew png new graph button add action listener file menu get new action return new graph button
this method initializes new graph button
private jbutton get save graph button if save graph button null save graph button new jbutton save graph button set icon new image icon get class get resource org grapheditor gui icons 16x16 fileopen png save graph button add action listener file menu get open action return save graph button
this method initializes save graph button
private jbutton get save button if save button null save button new jbutton save button set icon new image icon get class get resource org grapheditor gui icons 16x16 filesave png save button add action listener file menu get save action return save button
this method initializes save button
public void graph properties changed final graph properties prop graph pane get graph properties prop add graph change listener new graph change listener public void graph changed get save button set enabled true prop add save listener new graph save listener public void graph saved get save button set enabled false
this shall happen when the properties of a graph is changed
public void split selected edges int vertices between graph operation helper split selected edges vertices between
removes the selected edges and inserts vertices between vertices between
private void initialize this set name view quickmenu this add get zoom in button this add get zoom out button this add get standard zoom level button
this method initializes this
private jbutton get zoom in button if zoom in button null zoom in button new jbutton zoom in button add action listener view menu get zoom in action zoom in button set icon new image icon get class get resource org grapheditor gui icons 16x16 viewmag png return zoom in button
this method initializes zoom in button
private jbutton get zoom out button if zoom out button null zoom out button new jbutton zoom out button set icon new image icon get class get resource org grapheditor gui icons 16x16 viewmag png zoom out button add action listener view menu get zoom out action return zoom out button
this method initializes zoom out button
private jbutton get standard zoom level button if standard zoom level button null standard zoom level button new jbutton standard zoom level button set icon new image icon get class get resource org grapheditor gui icons 16x16 viewmag1 png standard zoom level button add action listener view menu get default zomm level action return standard zoom level button
this method initializes standard zoom level button
private void initialize j label1 new jlabel j label1 set text this set layout new box layout this box layout x axis this set border border factory create bevel border bevel border lowered this add get jpanel null this add get box null this add get jpanel1 null
this method initializes this
private jlabel get insert mode status label if insert mode status label null insert mode status label new jlabel insert mode status label set text jlabel return insert mode status label
this method initializes insert mode status label
public void do complete bipartite graph operation graph operation helper do complete bipartite graph operation
does a complete bopartite graph operation
private component get box if box null box box create glue return box
this method initializes box
private jpanel get jpanel if j panel null 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 label1 border layout center 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 x axis j panel1 set border border factory create bevel border bevel border lowered j panel1 add get insert mode status label null return j panel1
this method initializes j panel1
public void do graph cartesian product operation graph operation helper do graph cartesian product operation
does a graph cartesian prduct
public void do graph catergorial product operation graph operation helper do graph catergorial product operation
does a graph catergorial prduct
private void initialize this add get file menu this add get edit menu this add get view menu this add get selection menu this add get operations menu with vertex modification this add get properties menu this add get help about menu
this method initializes this
protected file menu get file menu if file menu null file menu new file menu graph pane main frame return file menu
this method initializes file menu
public edit menu get edit menu if edit menu null edit menu new edit menu graph pane return edit menu
this method initializes edit menu
private selection menu get selection menu if selection menu null selection menu new selection menu graph pane return selection menu
this method initializes selection menu
private jmenu item get save file menu item if save file menu item null save file menu item new jmenu item save file menu item set text save save file menu item set icon new image icon get class get resource org grapheditor gui icons 16x16 filesave png save file menu item set enabled false save action new java awt event action listener public void action performed java awt event action event e save save file menu item add action listener save action return save file menu item
this method initializes save file menu item
public view menu get view menu if view menu null view menu new view menu graph pane main frame return view menu
this method initializes view menu
public properties menu get properties menu if properties menu null properties menu new properties menu main frame graph pane return properties menu
this method initializes properties menu
private help about menu get help about menu if help about menu null help about menu new help about menu main frame return help about menu
this method initializes help about menu
private operations menu with vertex modification get operations menu with vertex modification if operations menu null operations menu new operations menu with vertex modification graph pane return operations menu
this method initializes operations menu with vertex modification
public void make subgraph complete operation graph operation helper make subgraph complete operation
makes the selected part of the graph complete
public void place selected vertices in circle graph operation helper place selected vertices in circle
places the selected vertices in a circle
private jmenu item get save as file menu item if save as file menu item null save as file menu item new jmenu item save as file menu item set text save as save as file menu item set icon new image icon get class get resource org grapheditor gui icons 16x16 filesaveas png save as file menu item add action listener new java awt event action listener public void action performed java awt event action event e save as return save as file menu item
this method initializes save as file menu item
private void initialize this set size new dimension 450 500 this set title graph statistics this set content pane get root panel
this method initializes this
public void mirror selected vertices vertical graph operation helper mirror selected vertices vertical
mirror the selected vertices on a vertical axis
private jpanel get root panel if root panel null root panel new jpanel root panel set layout new border layout root panel add get ok panel border layout south root panel add get title panel border layout north root panel add get information panel border layout center return root panel
this method initializes root panel
private jpanel get ok panel if ok panel null ok panel new jpanel ok panel set layout new box layout get ok panel box layout x axis ok panel set border border factory create bevel border bevel border raised ok panel add box create glue ok panel add get okej button return ok panel
this method initializes ok panel
public void mirror selected vertices horizontal graph operation helper mirror selected vertices horizontal
mirror the selcted vertices on a horizental axis
private jpanel get title panel if title panel null j label new jlabel j label set text graph statistics j label set font new font dialog font bold 24 title panel new jpanel title panel set layout new grid bag layout title panel set border border factory create bevel border bevel border raised title panel add j label new grid bag constraints return title panel
this method initializes title panel
private jpanel get information panel if information panel null information panel new jpanel information panel set layout new border layout information panel add get jscroll pane border layout center return information panel
this method initializes information panel
private jbutton get okej button if okej button null okej button new jbutton okej button set text ok okej button add action listener new java awt event action listener public void action performed java awt event action event e set visible false return okej button
this method initializes okej button
public void rotate selected vertices graph operation helper rotate selected vertices
rotate the selected vertices
private jscroll pane get jscroll pane if j scroll pane null j scroll pane new jscroll pane j scroll pane set autoscrolls false j scroll pane set border null j scroll pane set viewport view get information text pane return j scroll pane
this method initializes j scroll pane
public void select all graph operation helper select all
selects all vertices and edges in the graph
private void save to file file file graph saver saver new graph saver graph pane try file writer writer new file writer file saver write writer writer close current graphs file file current graph associate with file true graph pane get graph properties set saved as file catch ioexception e1 todo auto generated catch block e1 print stack trace joption pane show message dialog get root pane can not save to file file get absolute path n because of the following reason n e1 get message unable to save file joption pane error message
tries to save to the specified file
public void select neighbour graph operation helper select neighbour
selects all neighour vertices of selected verices
public void select other graph operation helper select other
select the compliment of selected verices and deselect all previus
public void select reachable graph operation helper select reachable
selects reachable vertices in the graph
private void initialize this set title global properties program name this set preferred size new dimension 500 500 this set size new dimension 307 163 this set content pane get jpanel this set jmenu bar get main menu this add window listener new java awt event window adapter public void window closing java awt event window event e exit window
this method initializes this
private void initialize this set size new dimension 400 400 this set title about global properties program name this set content pane get root panel
this method initializes this
private jpanel get title panel if title panel null j label new jlabel j label set text about global properties program name j label set font new font dialog font bold 24 title panel new jpanel title panel set layout new grid bag layout title panel set border border factory create bevel border bevel border raised title panel add j label new grid bag constraints return title panel
this method initializes title panel
private main menu get main menu if main menu null main menu new main menu get graph editor pane this return main menu
this method initializes main menu
private jpanel get information panel if information panel null 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 information panel new jpanel information panel set layout new grid bag layout information panel add get jscroll pane grid bag constraints return information panel
this method initializes information panel
private jpanel get jpanel if j panel null j panel new jpanel j panel set layout new border layout j panel add get tool bar panel border layout north j panel add get graph pane scroll pane border layout center j panel add get status bar panel border layout south return j panel
this method initializes j panel
private jscroll pane get jscroll pane if j scroll pane null j scroll pane new jscroll pane j scroll pane set viewport view get information text pane return j scroll pane
this method initializes j scroll pane
private void initialize this set layout new border layout this add get jpanel border layout north
this method initializes this
public jscroll pane get graph pane scroll pane if graph pane scroll pane null graph pane scroll pane new jscroll pane graph pane scroll pane set viewport view get graph editor pane return graph pane scroll pane
this method initializes graph pane scroll pane
private graph editor pane get graph editor pane if graph editor pane null graph editor pane new graph editor pane this get status bar panel get status bar panel set graph pane graph editor pane graph editor pane set anti aliased global properties get instance is antialiasing graph editor pane set double buffered global properties get instance is double buffering return graph editor pane
this method initializes graph editor pane
private jpanel get jpanel if j panel null j panel new jpanel j panel set layout new box layout get jpanel box layout y axis j panel set name j panel j panel add get jpanel1 null j panel add get jpanel11 null return j panel
this method initializes j panel
private jpanel get jpanel1 if j panel1 null grid bag constraints grid bag constraints new grid bag constraints grid bag constraints gridx 0 grid bag constraints gridy 0 j panel1 new jpanel j panel1 set layout new box layout get jpanel1 box layout x axis j panel1 set border border factory create titled border null antialias titled border default justification titled border default position null null j panel1 add get antialias check box null j panel1 add box create glue return j panel1
this method initializes j panel1
private jcheck box get antialias check box if antialias check box null antialias check box new jcheck box antialias check box set text enable antialias on graph antialias check box set selected global properties get instance is antialiasing return antialias check box
this method initializes antialias check box
public void graph properties changed final graph properties prop get graph editor pane get graph properties prop add graph change listener new graph change listener public void graph changed if prop is exists on file system set title prop get saved as get name changed global properties program name else set title new graph changed global properties program name prop add save listener new graph save listener public void graph saved set title prop get saved as get name global properties program name
this shall happen when the properties of a graph is changed
private jpanel get jpanel11 if j panel11 null grid bag constraints grid bag constraints1 new grid bag constraints grid bag constraints1 gridx 0 grid bag constraints1 gridy 0 j panel11 new jpanel j panel11 set layout new box layout get jpanel11 box layout x axis j panel11 set border border factory create titled border null double buffering titled border default justification titled border default position new font dialog font bold 12 new color 51 51 51 j panel11 add get double buffering check box null j panel11 add box create glue return j panel11
this method initializes j panel11
private jcheck box get double buffering check box if double buffering check box null double buffering check box new jcheck box double buffering check box set text enable double buffering on graph double buffering check box set selected global properties get instance is double buffering return double buffering check box
this method initializes double buffering check box
private file tool bar get file tool bar if file tool bar null file tool bar new file tool bar get graph editor pane get main menu get file menu return file tool bar
this method initializes file tool bar
private edit tool bar get edit tool bar if edit tool bar null edit tool bar new edit tool bar get graph editor pane main menu get edit menu return edit tool bar
this method initializes edit tool bar
public void fire changed event changed true for graph change listener l graph change listeners l graph changed
this method shall be called if something in the graph that is not
private view tool bar get view tool bar if view tool bar null view tool bar new view tool bar main menu get view menu return view tool bar
this method initializes view tool bar
private status bar panel get status bar panel if status bar panel null status bar panel new status bar panel return status bar panel
this method initializes status bar panel
private jmenu get import from file menu if import from file menu null import from file menu new jmenu import from file menu set text import from import from file menu add get random import menu item import from file menu add get mathematica import menu item return import from file menu
this method initializes import from file menu