input
stringlengths
10
828
output
stringlengths
5
107
protected boolean has element changed if get selected item null return initial item null else return get selected item equals initial item
return whether selected model element has changed since inital setting
protected void save0or1 dependency java lang class dependency class if has element changed 1 remove current dependency if initial dependency null client remove client dependency initial dependency initial dependency null 2 add new dependency if get element null try model element supplier model element get element initial dependency dependency element factory create dependency dependency class client supplier catch throwable e launcher view get instance handle exception e
return a dependency of the given class
protected void set0or1 dependency java lang class dependency class model element client set element ch ehi interlis views viewable def class client get supplier dependency class client
fill combo box with potential dependency elements and
protected void set element java lang class reference class model element model element model element current model element set display list ch ehi interlis tools model element utility get referencable elements model element reference class model element current model element
fill a combo box of referencables and set a given model element
public object get object return domain def
return the changed object displayed
public void set dialog java awt dialog owner owner dialog owner
set the object to be displayed by panel
public void set object java lang object object model element abstract class def domain def ch ehi interlis domainsandconstants domain def object this abstract class def abstract class def abstract class def if domain def null get btn change domain def set enabled false get txt domain def name set text non nls 1 else get txt domain def name set text ch ehi interlis domainsandconstants domain def object get def lang name get btn change domain def set enabled true
set the object to be displayed by panel
private void btn file search file chooser dialog new file chooser launcher view get settings get working directory dialog set dialog title res interlis2 def dialog get string ctassign filename non nls 1 dialog add choosable file filter launcher view create interlis model filter if dialog show save dialog this jfile chooser approve option try launcher view get settings set working directory dialog get current directory get absolute path string file name dialog get selected file get absolute path get txt filename set text file name catch throwable e handle exception e
show a save dialog
public void append text string log text append raw text escape text log text
append a log message without a specific theme
public void append text string title string log text append raw text escape text title log text non nls 2 non nls 1
append a log message with a specific theme
public void append text string id string title string log text tracer get instance debug id id log text append raw text escape text title a href id escape text log text a non nls 1
append a log message with a specific theme
public void clear perform the clear method body new string buffer get txa log set text null
perform the clear method
private string get time java util gregorian calendar now new java util gregorian calendar now get time to string java text simple date format formater new java text simple date format hh mm ss non nls 1 return formater format now get time
return time now as string
protected void handle exception java lang throwable exception ch softenvironment view base dialog show error java awt component this null exception to string exception non nls 1
called whenever the part throws an exception
private void mnc wrap lines wrap lines get mnc wrap lines is selected
show the lines wrapped or not
private void mni select node in tree string sel current line int start sel index of id non nls 1 if start 1 return int end sel index of start non nls 1 if end 1 return string id sel substring start 4 end trim model element model element model element launcher view get instance get model deep get element by id id launcher view get instance show specification model element
select all nodes in navigation tree where ids are selected in log text
public void toggle visibility set visible is visible
hide or show the statusbar
protected boolean save interlis2 def set version new double get txt interlislanguage version get text double value get pnl description get object return super save
save model element changes
private void mni move down attribute try int selv get tbl attributes get selected rows if selv length 0 editor table model get tbl attributes get model move row down selv 0 catch throwable e handle exception e
move down selected attribute in attributes list
private void mni move down role def try int selv get tbl roles get selected rows if selv length 0 editor table model get tbl roles get model move row down selv 0 catch throwable e handle exception e
move down selected role in roles list
private void activate frame drawing frame new frame if current frame new frame new frame get drawing view unfreeze view set current frame new frame try new frame set selected true catch java beans property veto exception e handle exception e
activate an internal frame and adapt corresponding tools
private void adapt sub panels if get settings get show tool bar boolean value get mnc toolbar set selected false if get settings get show status bar boolean value get mnc statusbar set selected false if get settings get show log view boolean value get mnc log view set selected false
adapt status bar and log view according to saved settings
protected boolean save if element utils try set name association def get txt name get text return false get pnl description get object page details association def set abstract get chx abstract is selected association def set prop final get chx final is selected if get pnl extended get classifier extension get txt name get text return false get cbx viewable ref save0or1 dependency association def derived class page constraints get pnl constraints get constraints return super save
save model element changes
private void set settings settings launcher view get settings get txt working directory set text settings get working directory get txt import directory set text settings get import directory get txt diagram width set text settings get diagram width to string get txt diagram height set text settings get diagram height to string
show settings values
private void initialize this add get txt year null this add get txt month null this add get txt day null this add get txt hours null this add get txt minutes null this add get txt seconds null this set size 103 29
this method initializes this
public string get selected language return selected language
returns the language selected by the user
private void select element javax swing event list selection event list selection event int index get lst search list get selected index if index 0 java util iterator iterator results iterator for int i 0 i index i iterator next element element element iterator next launcher view get instance get pnl navigation select element element
select element in browser
protected boolean save selected language ch ehi basics tools string utility purge string get cbx language get selected item return super save
overwrites in case ok button was pressed
private void mni new contract try update model contract contract element factory create contract model def update view editor table model get tbl contract get model add row element contract catch throwable e handle exception e
add a new item to table
private void mni new import model element selection dialog dialog new model element selection dialog this res model def dialog get string ctimport selection true model def non nls 1 get tbl import set model new editor table model editor table model get tbl import get model set client dependency model def iterator ili import res model def dialog get string tbc model def name header non nls 1
add new imports
protected boolean save translation set language get txt language get text translation set base language get txt base language get text return super save
save model element changes
public domain def get domain def return domain def
model element selection dialog constructor comment
public void add internal frame listener javax swing event internal frame listener new mdilistener mdi listeners add element new mdilistener
add a new listener to the applications internal frames
public void set domain list abstract class def abstract class def get lbl class name set text element utils get display name domain def class this abstract class def abstract class def get lst model elements set selection mode javax swing list selection model single selection fill list abstract class def domain def class
show a list of domain defs for given abstract class def
public void add view change listener ch ifa draw framework view change listener vsl
add view change listener method comment
public void set import list model def model def get lbl class name set text element utils get display name model def class this model def model def fill list model def model def class
show a list of model defs for given model def
public void set restricted role list role def role def get lbl class name set text element utils get display name class def class this role def role def fill list role def get association abstract class def class
show a list of class defs for given role def
public void set topic depends list topic def topic def get lbl class name set text element utils get display name topic def class this topic def topic def fill list topic def topic def class
show a list of topic defs for given topic def
private void mni remove contract editor table model get tbl contract get model remove rows get tbl contract get selected rows
remove selected items from list
protected boolean save if element utils try set name unit def get txt name get text return false if unit def get desc name null unit def set desc name new ch ehi basics types nls string get txt desc name get text else unit def set desc name new ch ehi basics types nls string unit def get desc name get txt desc name get text get pnl description get object page definition unit def set syntax get pnl syntax get syntax return super save
save model element changes
protected void close class diagram element diagram element tool done jinternal frame frame get internal frame diagram element if frame null frame dispose
close class diagram representing the given element
public void set object java lang object object ch ehi uml1 4 foundation core model element context java util set referencable elements this context context this referencable elements referencable elements update view abstract class def classv abstract class def object object data new object classv length 1 for int i 0 i classv length i data i 0 classv i model set data vector data new object element utils get display name abstract class def class
set the object to be displayed by panel
private void initialize this add get txt hours null this add get txt minutes null this add get txt seconds null this set size 103 29
this method initializes this
public object get child object parent int index if parent root return root get enum element at index return enum element parent get child get enum element at index
returns the child of parent at index index in the parents child array
public int get child count object parent if parent root return root size enum element if enum element parent contains child return enum element parent get child size enum element return 0
returns the number of children of parent
public int get index of child object parent object child if parent root return root find enum element enum element child return enum element parent get child find enum element enum element child
returns the index of child in parent
protected void fire tree nodes inserted enum element e
invoked after nodes have been inserted into the tree
protected void fire tree nodes removed enum element e
invoked after nodes have been removed from the tree
protected void fire tree structure changed enumeration node int len tree model listeners size tree path path get tree path or null node if path null return tree model event e new tree model event this path for int i 0 i len i tree model listener tree model listeners element at i tree structure changed e
invoked after the tree has drastically changed structure from a given node down
public void meta model changed ch ehi uml1 4 changepropagation meta model change event object source event get source string ops event get operation if source instanceof enum element if is attribute ops name fire tree nodes changed enum element source if source instanceof enumeration if is attribute ops enum element fire tree structure changed enumeration source
adapts meta model changes to tree model events
protected boolean save name is non nls here meta object file set name new ch ehi basics types nls string meta object file get name get txt filename get text non nls 1 get pnl description get object return super save
save model element changes
public void set object java lang object object if object instanceof horiz alignment get rbt halignment set selected true else get rbt vertical set selected true
set the object to be displayed by panel
protected void fire tree nodes inserted element e
invoked after nodes have been inserted into the tree
protected void fire tree nodes removed element element int len tree model listeners size tree model event e new tree model event this get tree path element get tree path utility find parent node for int i 0 i len i if e get path 0 null tree model listener tree model listeners element at i tree nodes removed e
invoked after nodes have been removed from the tree
protected void fire tree structure changed element node int len tree model listeners size tree model event e new tree model event this get tree path node for int i 0 i len i tree model listener tree model listeners element at i tree structure changed e
invoked after the tree has drastically changed structure from a given node down
protected boolean save if element utils try set name model element get txt name get text return false get pnl description get object structure if model element contains structure model element detach structure if get cbx structure get element null model element attach structure class def get cbx structure get element return super save
save model element changes
public void add tree model listener tree model listener l if tree model listeners contains l tree model listeners add element l
adds a listener for the tree model event posted after the tree changes
public void set ordering string ordering current ordering ordering
doesnt fire a refresh event should be done by caller
protected boolean save if element utils try set name model element get txt name get text return false get pnl description get object syntax if model element instanceof ch ehi uml1 4 foundation core constraint constraint expression constraint model element get body set syntax get pnl syntax get constraint else if model element instanceof ili syntax ili syntax model element set syntax get pnl syntax get syntax return super save
save model element changes
public void set object java lang object object ch ehi uml1 4 foundation core model element model element initalize aggregations pnl numeric set object element factory create numeric type model element update view oid type oid oid type object if oid get kind oid kind any rb any set selected true else if oid get kind oid kind numeric rb numeric set selected true pnl numeric set object oid get oiddomain model element else if oid get kind oid kind text rb text set selected true pnl text set object oid get oiddomain
set the object to be displayed by panel
private void add menu item javax swing jmenu item item get mnu new add item item set visible true
add a menu item dynamically
public void deactivate super deactivate if get text tool is activated get text tool deactivate
terminates the editing of a text figure
private void drag association connector end figure target figure int x int y 1 presentation edge figure edited connection get edge set endpoint end point index node figure target figure get node 2 model ch ehi interlis associations role def edge figure edited connection get model element change participant ch ehi uml1 4 foundation core classifier node figure target figure get model element 3 show visual reconnect if end point index 0 edge figure edited connection set start connector end else end point index 1 edge figure edited connection set end connector end
disconnect current node and connect new target
private jhot draw text tool get text tool return text tool
return the text tool to which double clicks are delegated
public void dispose unregister listener super dispose
destroy this internal frame
protected void register listener if get drawing view instanceof class diagram view ch ehi uml1 4 changepropagation meta model get instance contains meta model listener this class diagram view get drawing view refresh unregister listener ch ehi uml1 4 changepropagation meta model get instance add meta model listener this
register this frames drawing for model changes
public void set drawing view drawing view new internal drawing view super set drawing view new internal drawing view if new internal drawing view instanceof class diagram view set title class diagram view new internal drawing view get title register listener register listener
set the drawing view which represents the internal frame
protected void unregister listener if get drawing view instanceof class diagram view ch ehi uml1 4 changepropagation meta model get instance contains meta model listener this unregister listener ch ehi uml1 4 changepropagation meta model get instance remove meta model listener this
unregister this frames drawing for model changes
private boolean is n ary if presentation assoc class get node contains association iterator roles presentation assoc class get node get association iterator role presentation int count 0 while roles has next roles next skip if count 2 return true return false
determine if this node must present a diamond or not
private void remove features if attribute figure null show attribute figure false attribute figure remove all get class diagram remove attribute figure attribute figure null presentation assoc class get node set class angle 0 0 presentation assoc class get node set class radius 0 0
remove association attribute figure if any
protected void remove labels if name figure null presentation assoc class get node get association set show name false get class diagram remove name figure name figure null if get node null presentation assoc class get node set name angle 0 0 presentation assoc class get node set name radius 0 0
remove visual components only in diagram
protected association attribute figure show attribute figure element start end element element model element todo nasty hack show attribute figure temporarily true update attribute figure ch ehi uml1 4 foundation core association start end element true return attribute figure
force attribute figure to be drawn
private boolean is within range point p int x int y int sensitive square length ch ehi umleditor application launcher view get settings get connector zone int value return java lang math abs p x x sensitive square length math abs p y y sensitive square length
check whether given point is in a minimal area range of given coordinates
protected jpopup menu adapt popup menu javax swing jpopup menu popup menu add specification menu popup menu overwrite this method in subclasses add special menu popup menu add select in browser menu popup menu popup menu add new jseparator add format menu popup menu add edit menu popup menu popup menu set light weight popup enabled true return popup menu
factory method to create a default popup menu
private void mni find model todo ch ehi umleditor application launcher view get instance nyi modell in nav tree selektieren
layout the figures in diagram automatically
protected void add deletion menu javax swing jpopup menu popup menu popup menu add new abstract action common user access get mni edit remove text public void action performed action event event remove visually popup menu add new abstract action remove in model public void action performed action event event remove in model
add a deletion entry to a popup menu
protected void update labels if name figure null name figure update view
refresh label figures
private void mni layout diagram ch ehi umleditor format layout diagram layout current diagram
layout the figures in diagram automatically
private void mni layout roles and multiplicities class diagram view view layout all visible multiplicities class diagram view view layout all visible rolenames
layout the shown rolenames and cardinalities in diagram automatically
private void mni print diagram ch ehi umleditor application launcher view get instance print class diagram class diagram view view
print the diagram
protected void show illegal relationship java lang string warning base dialog show warning java awt component launcher view get instance node figure get resource string association line connection class cwassociation not allowed non nls 1 warning
show warning message because relationship is illegal between current start and end figure
private void mni save diagram ch ehi umleditor objectcatalog object catalog write diagram class diagram view view
layout the figures in diagram automatically
protected void add special menu javax swing jpopup menu popup menu
add individual popup menu items for this class
public boolean can connect figure start figure end if start instanceof note figure end instanceof note figure should warn res note anchor line connection get string cwnote needed non nls 1 return false if start instanceof node figure end instanceof node figure should warn res note anchor line connection get string cwnode type non nls 1 return false return true
tests whether the two figures may be connected
protected element get end element java util iterator iterator get edge iterator endpoint if iterator has next iterator next skip note if iterator has next return element iterator next return null
return the ending element of the relationship which might be a
protected element get start element java util iterator iterator note get edge iterator endpoint if iterator note has next return element iterator note next else return null
return the starting element of the relationship which is always
protected void show illegal relationship java lang string warning base dialog show warning java awt component launcher view get instance res note anchor line connection get string cwconnection not established non nls 1 warning
show warning message because relationship is illegal between current start and end figure
protected undoable create undo activity return new jhot draw drag tracker undo activity view new point f last x f last y
factory method for undo activity
protected void add edit menu javax swing jpopup menu popup menu jmenu edit menu new jmenu common user access get mnu edit text edit menu add new abstract action remove in model public void action performed action event event remove in model popup menu add edit menu
add an deletion entry to a popup menu
protected element get end element if get model element null ch ehi uml1 4 foundation core generalization get model element contains parent return ch ehi uml1 4 foundation core generalization get model element get parent else return null
return the ending parent model element of the relationship
protected jpopup menu adapt popup menu javax swing jpopup menu popup menu add specification menu popup menu overwrite this method in subclasses add special menu popup menu add selection menu popup menu popup menu add new jseparator add format menu popup menu add edit menu popup menu popup menu set light weight popup enabled true return popup menu
configure a given popup menu
protected element get start element if get model element null ch ehi uml1 4 foundation core generalization get model element contains child return ch ehi uml1 4 foundation core generalization get model element get child else return null
return the starting child model element of the relationship
protected void add model element model element relationship set model element relationship get edge add subject relationship keep references get class diagram get diagram add presentation element get edge
save the presentation in model which will cause diagram to draw this edge
protected void show decoration set start decoration null arrow tip arrow new arrow tip 0 35 15 14 arrow set fill color ch ehi umleditor application launcher view get settings get background color arrow set border color get line color set end decoration arrow
decorate the relation ship ends
protected void show illegal relationship string warning base dialog show warning java awt component ch ehi umleditor application launcher view get instance node figure get resource string generalization line connection class cwgeneralization not allowed non nls 1 warning
show warning message because relationship is illegal between current start and end figure
public void show specification launcher view get instance show specification get model element
show the specification dialog of the presentation element
public boolean can connect figure start figure end object generalizable element client node figure start get model element get generalizable element start object generalizable element supplier node figure end get model element get generalizable element end if client instanceof classifier class figure is pseudo classifier client supplier instanceof classifier class figure is pseudo classifier supplier client instanceof topic def supplier instanceof topic def client instanceof ch ehi uml1 4 modelmanagement package supplier instanceof ch ehi uml1 4 modelmanagement package should warn res dependency line connection get string cwnodes must be classifier non nls 1 return false return true
tests whether the two figures may be connected
protected void add specification menu javax swing jpopup menu popup menu popup menu add new abstract action common user access get mni edit change window text public void action performed action event event show specification
add a specification entry to a popup menu
protected element get end element if get model element null return null else todo only first dependency supplier is treated return element ch ehi uml1 4 foundation core dependency get model element iterator supplier next
return the ending supplier model element of the relationship
protected element get start element if get model element null return null else todo nyi only first dependency client is treated iterator it ch ehi uml1 4 foundation core dependency get model element iterator client if it has next return element it next else tracer get instance developer error dependency should have had at least a client modelling problem return null
return the starting client by means dependent model element of the relationship