input
stringlengths 10
828
| output
stringlengths 5
107
|
|---|---|
public void read storable input dr throws ioexception super read dr string s dr read string if s to lower case equals attributes f attributes new figure attributes f attributes read dr
|
reads the figure from a storable input
|
public void draw all graphics g boolean is printing g instanceof print graphics g instanceof java awt print printer graphics draw background g if f backgrounds null is printing draw painters g f backgrounds draw drawing g if f foregrounds null is printing draw painters g f foregrounds if is printing draw handles g
|
draws the contents of the drawing view
|
public void draw graphics g figure enumeration fe boolean is printing g instanceof print graphics draw background g if f backgrounds null is printing draw painters g f backgrounds f drawing draw g fe if f foregrounds null is printing draw painters g f foregrounds if is printing draw handles g
|
draws the given figures
|
public void write storable output dw super write dw dw write int f display box x dw write int f display box y dw write int f display box width dw write int f display box height dw write string f text dw write boolean f is read only dw write storable f observed figure dw write storable f locator
|
writes the figure to storable output
|
public void draw handles graphics g enumeration k selection handles while k has more elements handle k next element draw g
|
draws the currently active handles
|
protected jcomponent create contents drawing view view if view instanceof component jscroll pane sp new jscroll pane component view sp set vertical scroll bar policy jscroll pane vertical scrollbar always sp set horizontal scroll bar policy jscroll pane horizontal scrollbar always return sp else return new jpanel
|
creates the contents component of the application
|
public void read storable input dr throws ioexception super read dr mark size dirty mark text dirty mark font dirty f display box x dr read int f display box y dr read int f display box width dr read int f display box height dr read int f text dr read string f is read only dr read boolean f observed figure figure dr read storable if f observed figure null f observed figure add figure change listener this f locator offset locator dr read storable set font create font
|
reads the figure from storable input
|
public void draw drawing graphics g f drawing draw g
|
draws the drawing
|
protected void update location if f locator null point p f locator locate f observed figure p x size width 2 f origin x p y size height 2 f origin y if p x 0 p y 0 will change basic move by p x p y changed
|
updates the location relative to the connected figure
|
public storage format manager create storage format manager storage format manager storage format manager new storage format manager storage format manager set default storage format new standard storage format storage format manager add storage format storage format manager get default storage format storage format manager add storage format new serialization storage format return storage format manager
|
factory method to create a storage format manager for supported storage formats
|
public void add background painter painter if f backgrounds null f backgrounds new vector 3 f backgrounds add element painter repaint
|
adds a background
|
public void remove background painter painter if f backgrounds null f backgrounds remove element painter repaint
|
removes a background
|
public void remove foreground painter painter if f foregrounds null f foregrounds remove element painter repaint
|
removes a foreground
|
public void add foreground painter painter if f foregrounds null f foregrounds new vector 3 f foregrounds add element painter repaint
|
adds a foreground
|
public void palette user over palette button button boolean inside tool button tool button tool button button if inside show status tool button name else show status f selected tool button name
|
handles when the mouse enters or leaves a palette button
|
public void tool done if f default tool button null set tool f default tool button tool f default tool button name set selected f default tool button
|
sets the default tool of the editor
|
public void add view change listener view change listener vsl listener list add view change listener class vsl
|
register to hear when the active view is changed
|
public void add figure selection listener figure selection listener fsl f selection listeners add fsl
|
add a listener for selection changes
|
protected void fire view selection changed event drawing view old view drawing view new view final object listeners listener list get listener list view change listener vsl null for int i listeners length 2 i 0 i 2 if listeners i view change listener class vsl view change listener listeners i 1 vsl view selection changed old view new view
|
an appropriate event is triggered and all registered observers
|
public void remove figure selection listener figure selection listener fsl f selection listeners remove fsl
|
remove a listener for selection changes
|
public void show status string string f status line set text string
|
shows a status message
|
public void exit destroy set visible false hide the jframe dispose tell windowing system to free resources win count if win count 0 system exit 0
|
exits the application
|
public void mouse pressed mouse event e request focus jdk1 1 point p constrain point new point e get x e get y f last click new point e get x e get y tool mouse down e p x p y check damage
|
handles mouse down events
|
public void prompt new tool done view set drawing create drawing view drawing set title get default drawing title
|
resets the drawing to a new empty drawing
|
public void mouse released mouse event e point p constrain point new point e get x e get y tool mouse up e p x p y check damage
|
handles mouse up events
|
public void prompt open tool done jfile chooser open dialog create open file chooser get storage format manager register file filters open dialog if open dialog show open dialog this jfile chooser approve option storage format found format get storage format manager find storage format open dialog get file filter if found format null load drawing found format open dialog get selected file get absolute path else show status not a valid file format open dialog get file filter get description
|
shows a file dialog and opens a drawing
|
public void mouse dragged mouse event e point p constrain point new point e get x e get y tool mouse drag e p x p y check damage
|
handles mouse drag events
|
public void prompt save as tool done jfile chooser save dialog create save file chooser get storage format manager register file filters save dialog if save dialog show save dialog this jfile chooser approve option storage format found format get storage format manager find storage format save dialog get file filter if found format null save drawing found format save dialog get selected file get absolute path else show status not a valid file format save dialog get file filter get description
|
shows a file dialog and saves drawing
|
public void mouse moved mouse event e tool mouse move e e get x e get y
|
handles mouse move events
|
public void set ui javax swing plaf panel ui ui
|
patch necessary method for jsdk1
|
protected jfile chooser create open file chooser jfile chooser open dialog new jfile chooser open dialog set dialog title open file return open dialog
|
create a file chooser for the open file dialog
|
protected jfile chooser create save file chooser jfile chooser save dialog new jfile chooser save dialog set dialog title save file return save dialog
|
create a file chooser for the save file dialog
|
protected void load drawing storage format restore format string file try drawing restored drawing restore format restore file if restored drawing null restored drawing set title file new window restored drawing else show status unknown file type could not open file file catch ioexception e show status error e
|
load a drawing from a file
|
protected boolean save if element utils try set name generalization get txt name get text return false get pnl description get object generalization set discriminator new ch ehi basics types nls string generalization get discriminator get txt diskriminator get text return super save
|
save model element changes
|
public void set object java lang object object ch ehi uml1 4 foundation core model element context this context context update view participants panel item classv participants panel item 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
|
public nls string get constraint string syntax get pnl editor get text if syntax null syntax length 0 replace current value if constraint expression constraint get body get syntax null return new ch ehi basics types nls string syntax else return new ch ehi basics types nls string constraint expression constraint get body get syntax syntax else return null
|
return the very one constraint
|
public model element get constraints model element clear constraint java util iterator iterator get pnl data selector get objects iterator try while iterator has next constraint expression expression new constraint expression expression set syntax nls string iterator next constraint def constraint def constraint def element factory create object constraint def class constraint def set body expression model element add constraint constraint def catch throwable e handle exception e return model element
|
return the model element with changed constraints
|
public model element get parameter defs class def model element clear parameter def try java util iterator iterator get pnl data selector get objects iterator while iterator has next parameter def expression parameter def element factory create object parameter def class expression set syntax nls string iterator next class def model element add parameter def expression catch throwable e handle exception e return model element
|
return the changed object displayed
|
protected void handle exception java lang throwable exception ch softenvironment view base dialog show error java awt component this get resource string cesyntax exception to string exception non nls 1
|
called whenever the part throws an exception
|
public void remove object java lang object object
|
called when current object is to be removed
|
public void set constraint constraint constraint this constraint constraint get pnl data selector set visible false get pnl editor set editable true if constraint expression constraint get body get syntax null get pnl editor set text new string else get pnl editor set text element utils map nls string constraint expression constraint get body get syntax
|
use the panel for single constraint only
|
public void set current object java lang object syntax if syntax null get pnl editor set editable false get pnl editor set text null else get pnl editor set editable true get pnl editor set text element utils map nls string ch ehi basics types nls string syntax
|
display the given syntax in simple editor panel
|
public void set parameter defs model element model element this model element model element java util iterator iterator class def model element iterator parameter def java util array list list new java util array list while iterator null iterator has next parameter def parameter def parameter def iterator next list add parameter def get syntax get pnl data selector set objects list
|
set the object to be displayed by panel
|
protected boolean save if element utils try set name dependency get txt name get text return false get pnl description get object return super save
|
save model element changes
|
public void set usage model element model element get pnl usage set visible true get cbx usage set enabled get cbx usage set usage model element
|
the following types may specify an uml usage
|
protected void handle exception java lang throwable exception launcher view get instance handle exception exception
|
called whenever the part throws an exception
|
public object get object if get txt value get text null get txt value get text length 0 return null else ili dim ili dim ili dim parse ili dim get txt value get text if get cbx accuracy get selected index 0 ili dim set accuracy long get cbx accuracy get selected item long value else assume 0 ili dim set accuracy 0 return ili dim
|
return the changed object displayed
|
protected void handle exception java lang throwable exception ch softenvironment view base dialog show error java awt component this get resource string cterror exception to string exception non nls 1
|
called whenever the part throws an exception
|
protected boolean save uml model set author get txt author get text uml model set version get txt version get text get pnl description get object return super save
|
save model element changes
|
public void set object object object ili dim ili dim ili dim object if ili dim null get txt value set text null get cbx accuracy set selected index 0 else get txt value set text ili dim to string get cbx accuracy set selected item new long ili dim get accuracy
|
set the object to be displayed by panel
|
protected boolean save contract set issuer new ch ehi basics types nls string contract get issuer get txt issuer get text contract set explanation new ch ehi basics types nls string contract get explanation get txt explanation get text get pnl description get object return super save
|
save model element changes
|
private void mni move down attribute 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
|
move down selected attribute in attributes list
|
private void fill tree view namespace apackage get tre tree set model new navigation tree model apackage true
|
sets up the tree content
|
public namespace get selected package return selected package
|
returns the package selected by the user
|
protected boolean save selected package namespace get tre tree get selection path get last path component return super save
|
overwrites in case ok button was pressed
|
private void initialize this add get txt year null this add get txt month null this add get txt day null this set size 103 29
|
this method initializes this
|
public void set connector zone integer square side set property connector zone square side to string
|
sets the sensitive area length of dragging an edge to another node
|
public void set diagram height java lang integer diagram height set property diagram height diagram height to string
|
sets the diagram height property java
|
public void set diagram width java lang integer diagram width set property diagram width diagram width to string
|
sets the diagram width property java
|
public void set show log view java lang boolean show log view set property show log view show log view to string
|
sets the show log view property java
|
private void length state changed java awt event item event item event boolean is selected get rbt multi line is selected get rbt single line is selected get txt length set editable is selected get txt length set enabled is selected
|
control length text field
|
public boolean get classifier extension string name return check name extension name get extension
|
check and save generalization back to repository if changed
|
private void handle exception java lang throwable exception launcher view get instance handle exception exception
|
called whenever the part throws an exception
|
public void set classifier extension generalizable element generalizable element set extendables generalizable element set the generalization by name boolean extended false if current generalization null abstract class def generalizable element contains parent topic def topic def topic def this abstract class def generalizable element get parent topic def if current generalization instanceof class extends topic def this contains base topic def set extended only as selected if inside an extended topic extended class extends current generalization is extended get chx extended set selected extended
|
set the element of which this panel shows the extens extended info
|
public void set extension domain def generalizable element set extendables generalizable element get chx extended set visible false
|
show the parent of the given generalization in the drop down list
|
private void set polyline ili polyline poly line model element model element get chx directed set visible true get lbl line attributes set visible false get cbx class def set visible false if poly line null get chx directed set selected false else get chx directed set selected poly line is directed set linetype poly line model element
|
set the object to be displayed by panel
|
private vector create row attribute def attribute def vector row new vector 4 row add attribute def get def lang name row add multiplicity converter get range attribute def get multiplicity row add ili base type kind get type name attribute def true return row
|
return row of given object
|
private vector create row line form type def line form type def vector row new vector 2 row add line form type def get def lang name return row
|
return row of given object
|
private vector create row abstract class def class def vector row new vector 2 row add class def get def lang name return row
|
return row of given object
|
private vector create row contract contract vector row new vector 2 row add element utils map nls string contract get issuer row add element utils map nls string contract get explanation return row
|
return row of given object
|
private vector create row translation translation vector row new vector 3 row add translation get language row add translation get base language return row
|
return a translation table row
|
private vector create row vector vector vector row new vector 3 row add vector get 0 row add vector get 1 return row
|
return a translation table row
|
public void set client dependency java util iterator iterator client dependency string column name define visible columns table kind other vector columns new vector 1 columns add column name set data vector element vector columns build data rows while iterator client dependency null iterator client dependency has next add row element dependency iterator client dependency next
|
set a model defs imported element
|
public void set contract java util iterator iterator contract table kind other define visible columns vector columns new vector 1 columns add res editor table model get string tbc contract issuer text non nls 1 columns add explanation set data vector element vector columns build data rows while iterator contract null iterator contract has next add row element contract iterator contract next
|
set a model defs contract
|
private void add dimension panel ili base type numeric panel panel int dimension get tbp numeric types add panel get tbp numeric types set title at dimension 1 dimension tab title
|
show a tab panel
|
protected void show specification int selected rows for int i 0 i selected rows length i int current row index selected rows i vector current data row vector element vector get current row index element element element current data row get current data row size 1 launcher view get instance show specification element update row current row index current data row element
|
display a specification dialog for the
|
private string get parameter type string final int kind if kind ch ehi uml1 4 foundation datatypes parameter direction kind in return in else if kind ch ehi uml1 4 foundation datatypes parameter direction kind out return out else if kind ch ehi uml1 4 foundation datatypes parameter direction kind inout return in out else tracer get instance developer warning non supported kind kind return kind
|
return a speaking name for int constant
|
static private icon get package leaf icon boolean expanded if expanded else return javax swing uimanager get icon tree closed icon return null will adapt closed opened package automatically
|
return the standard package symbol
|
static public boolean has specification element element show uml model in root node instead of logical view return element utils get element dialog element null
|
return whether specification dialog exists or not
|
static public boolean is association def element node return node instanceof ch ehi interlis associations association def
|
return whether tree element is a association def or not
|
static public boolean is class def element node return node instanceof ch ehi interlis modeltopicclass class def
|
return whether tree element is a class def or not
|
static public boolean is class diagram object element return element instanceof ch ehi umleditor umlpresentation diagram
|
return whether tree element is a diagram or not
|
static private boolean is model element object element return element instanceof model element
|
return whether tree element is a model element or not
|
static public boolean is node editable element node return node instanceof ch ehi uml1 4 implementation uml model node instanceof ch ehi interlis metaobjects meta object file
|
return whether node mapping this tree element might be renamed
|
static public boolean is node removable element node return node instanceof ch ehi uml1 4 implementation uml model
|
return whether node mapping this tree element might be removed
|
static public boolean is node movable element node return node instanceof ch ehi uml1 4 implementation uml model node instanceof ch ehi uml1 4 foundation core feature node instanceof ch ehi uml1 4 foundation core association end
|
return whether node mapping this tree element might be moved
|
static public void set name object node string new name if is model element node model element node set name new ch ehi basics types nls string model element node get name new name else if is class diagram node ch ehi umleditor umlpresentation diagram node set name new ch ehi basics types nls string ch ehi umleditor umlpresentation diagram node get name new name
|
sets the string to display for this object
|
private enum element get selected node tree path sel path get tre enumeration get selection path if sel path null return enum element sel path get last path component return null
|
returns the tree node instance that is selected in the tree
|
private void mni move down parameter launcher view get instance nyi move down parameter int selv get tbl parameters get selected rows if selv length 0 editor table model get tbl parameters get model move row down selv 0
|
move down selected parameter in parameters list
|
public int compare object o1 object o2 if o1 o2 return equal only if it is the same object otherwise the element may not find its way into the lists return 0 int ret model element o1 get def lang name compare to model element o2 get def lang name if ret 0 return ret compare path to elements return model element utility get uml path model element o1 null compare to model element utility get uml path model element o2 null
|
compare by default language name
|
private void mni new deep try enum element parent node get selected node enum element new element element factory create enum element if parent node contains child parent node attach child new enumeration parent node get child add enum element new element select element new element mni rename catch throwable e handle exception e
|
create new subtree at selected node
|
private void mni new flat try enum element selected node get selected node enum element new element element factory create enum element if selected node null root add enum element new element else if selected node get enumeration root use root int idx root find enum element selected node root add enum element idx new element else int idx selected node get enumeration find enum element selected node selected node get enumeration add enum element idx new element select element new element mni rename catch throwable e handle exception e
|
add leaf to selected node
|
private void mni rename tree path path get tre enumeration get selection path if path null get tre enumeration start editing at path get tre enumeration get selection path
|
start renaming by setting cursor on tree node
|
private void save documentation get pnl description get object
|
save the documentation on currently selected enum element
|
private void selection changed javax swing event tree selection event tree selection event enum element node get selected node if node null get pnl description set enabled false get pnl description set object null else enum element get pnl description set enabled true get pnl description set object node
|
adapt anything when tree selection changes
|
public void set object java lang object object if object null root new enumeration else root copy tree enumeration object enumeration type root switch type get kind case enum kind undefined get rbt undefined set selected true break case enum kind ordered get rbt ordered set selected true break case enum kind circular get rbt ordered circular set selected true break default throw new ch softenvironment util developer exception unknown kind type get kind non nls 1 model set root root
|
set the object to be displayed by panel
|
protected void fire pnl editor simple editor panel txa editor key key released java util event object new event if field description panel listener event multicaster null return field description panel listener event multicaster pnl editor simple editor panel txa editor key key released new event
|
method to support listener events
|
public void set enabled boolean enabled get pnl editor set enabled enabled get pnl editor set editable enabled
|
set the text area enabled or not
|
public void set object java lang object object this element element object if object null get pnl editor set text null else get pnl editor set text element utils map nls string element get documentation
|
set the object to be displayed by panel
|
protected model element get element if get selected index 0 iterator iterator referencables iterator string name string get selected item while iterator has next model element model element model element iterator next if element utils format with package name model element equals name return model element return null
|
return the selected model element in combo box
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.