input
stringlengths
10
828
output
stringlengths
5
107
protected iterator get text attributes eventually we ll keep a collection of these but for the moment we only have one our name return collections singleton nameattribute iterator
returns an iterator of our text attributes
public string get name model object mo get model object if mo null return null return mo get name
returns the name or annotation of this graphic view object
public telos parser individual get label model object mo get model object if mo null return null return mo get label
returns the name or annotation of this graphic view object
public void set name string newname d o setting name newname try if newname null get model object null get model object set name newname else if omedefault plugin cltm null if get model object null get model object set name omedefault plugin cltm invoke catch exception e d a e update name update the cache
sets the name of this graphic view object
public void set label telos parser individual newname try get model object set label newname catch exception e d a e update label update the cache
sets the name of this graphic view object
public string get comment return get model object get comment
returns the comment of the object
public void set comment string newcomment d o setting comment try get model object set comment newcomment catch exception e d a e
set the comment for the object
public void update name nameattribute set text get name
updates our name without changing the name of the model object
public model object get model object return modelobject
returns the model side object this graphic view element represents
protected int max pref text width ultimately this constant may be pulled from the model int inner text margin 5
our preferred maximum text width is our image minus an inset
public collection get links iterator i get model object get links iterator linksiteratorbuilder clear while i has next linksiteratorbuilder add view get view link model link i next return linksiteratorbuilder
returns an collection of graphic view links which correspond to links of
public void clear message use a space otherwise the status bar will shrink label set text
clears status bar message
public string get model path file f new file path if f exists string p try p f get absolute file get canonical path return p catch ioexception e e print stack trace return
returns the absolute path of the model opened up in the frame
public void set model path string newpath path newpath
set the path of the model opened up in the frame
protected jmenu bar create menu bar jmenu bar menu bar new jmenu bar return menu bar
creates a menu bar
public graphic view status bar get status bar return status bar
returns the status bar
public void add tool bar jtool bar tb toolbars add tb
adds the given toolbar to the toolbar panel
public void set toolbar jpanel newtbpanel new jpanel newtbpanel set layout new box layout newtbpanel box layout x axis newtbpanel set alignment x left alignment iterator i get toolbar layout while i has next jpanel jp jpanel i next jp set layout new box layout jp box layout x axis newtbpanel add jp toolbarpanel add newtbpanel
updates the toolbar area
protected void set window listener plugin method m wl window listener new gvfwindow listener m
sets up the window listener for this frame attaching the given method
public void window closing window event e close frame method false
process the window closing event most of this is yet to be
protected void set filename string n filename n
sets the filename associated with this graphic view
package public void set graphic view canvas graphic view canvas gvc if gvc null this gvc gvc
set the gui side of this graphic view
private void report parameter method pass parameter v plugin parameter p method next parameter we re done with v now kill it v new vector if p null we re done here invoke the method method invoke reset pc else keep on truckin get parameter p the state of the model might have changed better repaint view update view repaint
feeds the parameter weve been collecting to our method and
public image get scaling image image double scale if image null return get scaling image scale scale return null
return the specified image and size loading it from the scale table if
public image get sizing image im int width int height double widthfactor 1 0 double heightfactor 1 0 if width 0 height 0 widthfactor width float get width im heightfactor height float get height im else if width 0 widthfactor width float get width im heightfactor widthfactor else if height 0 heightfactor height float get height im widthfactor heightfactor return get scaling im widthfactor heightfactor
returns a rescaled version of the specified image to the specified height
public graphic view canvas get graphic view canvas return gvc
returns the graphic view canvas for this graphic view
public image get image object handle return image images get handle
returns the image with the handle
public image put image string filename object handle d o filename filename try d o this get class get resource resources filename image image toolkit get default toolkit get image this get class get resource resources filename d o image table adding filename mediatracker add image image 0 images put handle image mediatracker wait for all 0 return image catch exception e e print stack trace return null
stores the image into the cache with the passed handle
public int get width image i if i null return i get width this else return 0
gets the width of an image
public int get height image i if i null return i get height this else return 0
gets the height of an image
public image draw hline image im if im null buffered image bi new buffered image get width im get height im buffered image type int argb graphics2 d g graphics2 d bi get graphics g draw image im 0 0 this g set color color black g set stroke new basic stroke 2 0f g draw line 0 get height im 2 get width im get height im 2 return bi else return null
draws a horizontal line through through an image and returns the result
public font get default font return gvc get font
returns the default font for the graphic view
public int get mnemonic return 1
the mnemonics index to be used for listing the mnemonics
protected void cancel method d o cancelling method gvc set mode normal mode null method cancelled reset pc
the user has abandoned the method he was in the middle of
protected font metrics get font metrics font f they really want gvc s font metrics return gvc get font metrics f
gets the font metrics associated with this view
public void set canvas canvas c canvas c
set the gui side of this graphic view
private void reset pc d o resetting parameter collector untoggle our button if we had one if button null button set selected false clear our fields method null button null
resets the parameter collector so that it is ready to start a new
public canvas get canvas return canvas
get the gui side of this graphic view
public void hookup save method iterator plugit plugins iterator while plugit has next omeplugin p omeplugin plugit next if p instanceof omedefault plugin gframe set window listener omedefault plugin p get save method view return
searches through our plugins for the omedefault plugin gets the save
public image get image object type return framework get image type
returns the image that is associated with the given object for this
private image icon iconify image image im if im null image table it view get image table im it get scaling im icon height it get height im im it get sizing im 0 icon height return new image icon im else return null
scales image and converts ito an image icon
public collection get all elements return elements
returns a collection of all the view elements within this graphic view
public collection get all links return links
returns a collection of all the view links within this graphic view
public collection get highlighted objects return highlighted
returns the view objects that are highlighted
public collection get selected elements return selectedelements
returns a collection of the selected elements within this graphic view
public collection get selected links return selectedlinks
returns a collection of the selected links withing this graphic view
protected graphic view get data return view
returns the private member view
public collection get selected objects collection c new hash set c add all get selected elements c add all get selected links return c
returns a collection of all the selected elements and links within this
protected void show dialog jdialog jd repaint jd set modal true jd pack jd set location relative to this jd set visible true
displays the given jdialog to the user
public collection get expanded elements return expandedelements collection c new vector iterator i get all elements iterator while i has next graphic view element gve graphic view element i next if gve is expanded c add gve return c
returns a collection of the expanded elements within this graphic view
public collection get expandable elements throws exception if true throw new exception get expandable elements can t work return expandableelements
returns a collection of the expandable elements within this graphic view
protected void set sbh value int value view get display bounds x value adjust scroll bar view refresh visible
sets the view value in code graphic view code according to the value
public collection get visible elements return visibleelements
returns a collection of the visible elements within this graphic view
public collection get visible links return visiblelinks
returns a collection of the visible links within this graphic view
public void select object view object vo graphic view object gvo deselect all gvo graphic view object vo gvo set selected true
selects the given object
protected void set scrollbars jscroll bar psbv jscroll bar psbh sbv psbv sbh psbh
passes the scroll bar objects to this class
private stroke get dashed stroke return new basic stroke 3 0f basic stroke cap butt basic stroke join miter 10 0f dash 0 0f
returns a dashed stroke
protected void draw expanded elements graphics2 d g graphic view element ge if ge is dirty return rectangle rec ge get expanded bounds color bgcolor get background if to print g set color new color int 0 95 bgcolor get red int 0 95 bgcolor get green int 0 95 bgcolor get blue else g set color bgcolor fill circle g rec g set color color black stroke strokeholder g get stroke g set stroke get dashed stroke draw circle g rec g set stroke strokeholder draws the element image draw elements g ge
draws an expanded element
private object get individual impact model object offspring model link link object conttype if is nfrcorrelation link conttype convert correlation type link get type else conttype link get type object o evaluationcatalogue get new pair get label offspring conttype return o
this function essentially does the table look up for table 3
static public boolean is compatible with omemodel model return model get framework get type entity null
tests for presence of basic er type
public collection get toolbar methods view view collection c new vector a way to introduce new entities to the model object entity type model get framework get type entity plugin method entity method new create element method entity type entity view object rel type model get framework get type relationship plugin method rel method new create element method rel type relationship view object att type model get framework get type attribute plugin method att method new create element method att type attribute view return c
returns a collection of our code method code s that are to be
public collection get menubar methods view v return null
returns a collection of our code method code s that are to be
public collection get popup methods view view vector ll new vector ll add new show attribute method view return ll
returns a collection of our code method code s that are to be
public void set type class type this type type
sets the type of parameter expected
public int show dialog pack set location relative to owner set visible true return returnvalue
sets the location of the dialog and displays it
public image get image image i view get image type return i
returns the image associated with the object this method will create
private jpanel construct button panel jpanel panel new jpanel jbutton continuebutton new jbutton continue continuebutton add action listener new button listener continue panel add continuebutton jbutton cancelbutton new jbutton cancel cancelbutton add action listener new button listener cancel panel add cancelbutton return panel
constructs the button panel containing the continue and cancel buttons
public void action performed action event e returnvalue buttontype dispose
performs the appropriate action depending on the button pressed
public string get name return typename
returns the type of the object this method will create
public plugin parameter next parameter return nextp
get the next parameter to be used when this method is invoked
public void openup double componentpointx me get component get location on screen get x double componentpointy me get component get location on screen get y point p new point origin p x int me get x componentpointx p y int me get y componentpointy determine where to put menu origin get popup menu origin p convert back to relative coordinates origin x int origin x componentpointx origin y int origin y componentpointy show me get component origin x origin y
opens up the popup menu at the correct point
public void invoke if creation location null somethings wrong give up else try catch model errors try view object o view create element type creation location view prompt rename o catch exception e we have probably tried to create an element within the bounds of another and the kb won t allow this bad types we should make some specialized exceptions at some point d o semantic error creating element joption pane show message dialog null unable to create fw get name type at this location semantic error joption pane error message reset method and clean up reset method
execute this method
public int show dialog return dialog show dialog
displays the dialog requesting information about new model
public void cancelled reset method
cancel this method
private void reset method nextp first parameter creation location null params received 0
this cleans up the method preparing it to be used a new
public menu method string name this name name submenu new vector
constructs a menu method
public collection get submenu return submenu
returns a collection of code plugin method code s that are contained
private plugin parameter first parameter return new plugin parameter plugin parameter cardinality one null plugin parameter omecontext type
the first paramter we look for we will see if the context can
public void add item plugin method m submenu add m
adds the specified plugin method to the submenu collection
public void set submenu collection c submenu c
adds all the plugin methods in the specified collection to the submenu
private plugin parameter second parameter the first and only thing we are going to want to know is where to put the new element return new plugin parameter plugin parameter cardinality one please select where the new typename should be created plugin parameter location type
the second paramter we look for we use this if the context was
final public plugin parameter next parameter if got context p return context parameter else if objects collected num objects return object parameter else all objects have been collected return null
we try to get the object from the context first if possible
final public void pass parameter collection c view object vo if got context p view context con view context c iterator next got context p true vo con associated object if vo null we didn t get anything here but next time we will ask for an object directly return else object parameter vo view object c iterator next if is suitable vo objects collected viewobjects viewobjects objects collected vo objects collected otherwise it was no good please try again
accept the parameter we just asked for
final public void cancelled reset state reset method
if the method is cancelled we must return to the starting state
protected void reset method
override this method to perform any clean up that shoudl take place
private void reset state got context p false objects collected 0
sets the state of this method to the starting state
final public void invoke if objects collected num objects if num objects 1 operate viewobjects 0 else operate viewobjects reset state
invoke performs the operation on the method and then resets the state
protected boolean is suitable view object vo return true
override this method to perform a suitability test on the object
protected boolean is suitable view object vo int n view object collected this is just a default implementation intended to not break methods that were defined when this class only worked on one object if n 0 return is suitable vo return true
override this method to perform a suitability test on the nth object
protected void operate view object vo
for objects using 1 object
protected void operate view object viewobjects
for objects using more than 1 object
final public string get name return name
set the name for this method in subclass constructor
final public boolean is enabled view context con view object vo con associated object if vo null return is suitable vo 0 viewobjects return false
this method is only enabled if the view has an object associated with
private int num objects return viewobjects length
the number of objects this method uses
private string get instruction if num objects 1 return instruction else return instructions objects collected
gets the instruction for the next paramter we are collecting
public choice string name this name name
creates a choice with the specified name
public boolean mandatory return mandatory
returns whether this choice is mandatory or not
public string description return description
returns the user friendly description for this choice
public boolean chosen return chosen
returns whether this choice has been chosen
public object choice object return choiceobject
this method returns the object associated with this choice