input
stringlengths
10
828
output
stringlengths
5
107
public void set mandatory boolean m mandatory m something that is mandatory cannot be changed set enabled false something that is mandatory is chosen if mandatory chosen true
sets whether this choice is mandatory or not
public void set chosen boolean b chosen b
sets whether this choice is chosen
public void set choice object object o choiceobject o
sets the object associated with this choice
public void set enabled boolean b enabled b
sets whether the choice should be enabled
public void invoke system out println create link if sources null dest null somethings wrong give up else try catch model errors iterator i sources iterator while i has next view object vo view object i next if vo dest if type null d o controller create link method error type null view create link type vo get model object dest get model object else throw up a helpful don t connect to self message system out println don t connect to self and clean up reset method
execute this method
protected void reset method nextp context parameter expectingcontext true sources null dest null
this cleans up the method preparing it to be used a new
public iterator get models return models2vms key set iterator
returns an iterator over the models extant
public void prompt rename view object vo gvc open rename box graphic view object vo
prompts user to rename the given element
public void pass parameter collection c
passes a parameter as a singleton collection to this plugin method
public void invoke
execute this plugin method
public void cancelled
cancel this plugin method
private jpanel get choice panel collection choices jpanel choicepanel new jpanel choicepanel set layout new box layout choicepanel box layout y axis button group bg new button group iterator i choices iterator while i has next choice c choice i next jradio button rb new jradio button c name c chosen bg add rb rb set enabled c mandatory rb add item listener new checkbox choice listener c choicepanel add rb return choicepanel
creates and returns a choice panel to be displayed in the chooser
public collection get plugins omemodel model return collection models2plugins get model
returns the plugins that consider themselves compatible with this model
public checkbox chooser frame owner string title boolean modal super owner modal set title title this owner owner
this constructor should be used when extending this class in order to
private jpanel get choice panel collection choices jpanel choicepanel new jpanel choicepanel set layout new box layout choicepanel box layout y axis iterator i choices iterator while i has next choice c choice i next d o adding choice c name jcheck box cb new jcheck box c name c chosen cb set enabled c mandatory cb add item listener new checkbox choice listener c choicepanel add cb return choicepanel
creates the choice panel based on the collection of choices passed to it
public void action performed action event e returnvalue rv dispose
sets the returnvalue and disposes of the dialog window
public checkbox choice listener choice c super this c c
creates a checkbox choice listener with the specified choice
public void item state changed item event e if e get state change item event selected c set chosen true d o setting choice c name true else if e get state change item event deselected c set chosen false d o setting choice c name false
acts as a listener which toggles the state of the choice associated
public void set popup menu visible boolean b boolean is visible is popup menu visible if b is visible set location of popup menu pulldown or pullright perhaps this should be dictated by l f if b true is showing point p get popup menu origin get popup menu show this p x p y else get popup menu set visible false
sets whether the popupmenu is visible or not
public popup menu separator method view v
this does nothing
public void prompt straighten view object vo graphic view object gvo graphic view object vo gvo reset
prompts user to straighten the given link
private void straighten all links view view view set straighten true iterator j view get all links iterator while j has next view object vo view object j next view prompt straighten vo
straighten all links
public void save model to omemodel model file f throws exception individual individuals load individuals from model model file writer writer computing create writer with extension f tel int count 0 for int c 0 c individuals length c try if individuals c is builtin writer write jtelos util telos declaration individuals c n n count catch exception e d o exception writer flush writer close
commits a model and its serializable views to persistent storage
private void draw priority graphics2 d g graphic view element ge int p ge get priority if p 0 return iterator textattributes ge get text attributes graphic view object graphic view text attribute gvta graphic view object graphic view text attribute textattributes next text layout tl new text layout p gvta font gvta fontrc tl draw g ge get image bounds x 75 ge get image bounds y
draw the priority annotation to the upper right corner of the element
public void lay out omemodel model file file throws exception view manager vm get view manager model iterator i vm get views graphic view old view null while i has next old view graphic view i next save model to dot model old view file graph new graph jtelos util do parse file if new graph null jtelos util back to ome old view new graph
layout model using dot
public void prompt resize view object vo gvc open resize box graphic view object vo
prompts user to resize the given element
public void save model to vdx omemodel model file file throws exception telos parser kb kb telos parser kb models2kbs get model individual individuals load individuals from model model file writer writer computing create writer with extension file vdx string vdx get file contents n jtelos util save to vdx kb individuals write elements and links specific to model d o vdx length writer write vdx writer flush writer close
save file as
private void new element graphic view element gve d a gve null d o element id gve get id elements add gve model2viewobjects put gve get model element gve ids2gves put new integer gve get id gve mark dirty gve get selectable bounds set view dirty
add the new element to the appropriate lists
public void close model omemodel model models2vms remove model models2kbs remove model models2plugins remove model model null system gc
removes a model and its views
public void delete element view element ve model delete element graphic view element ve get model element get highlighted objects remove ve
deletes a view element and its corresponding model element
public view manager get view manager omemodel model return view manager models2vms get model
returns the viewmanager for a model
public void delete selected elements while selectedelements is empty delete element graphic view element selectedelements iterator next
deletes all selected elements within this graphic view
private void set antialiasing graphics2 d g g set rendering hint rendering hints key antialiasing antialias rendering hints value antialias on rendering hints value antialias off
sets the antialiasing of the passed graphics context to that of our
private void new link graphic view link gvl links add gvl model2viewobjects put gvl get model link gvl ids2gvls put new integer gvl get id gvl mark dirty gvl get dirty bounds set view dirty
adds the new link to the appropriate lists
private void draw graphics2 d g draw expanded elements g draw highlighted objects g drawlinks g drawelements g draw selected objects g draw selection box g
draws all expanded visible and not hidden objects
public void delete selected links while selectedlinks is empty delete link view link selectedlinks iterator next
deletes all the selected links within this graphic view
public void dirty link model link l d a l view link vl view link model2viewobjects get l if vl null l null the link is new graphic view link gvl new graphic view link l this new link gvl gvl update name since the name is cached mark dirty gvl get dirty bounds else if model get links contains l it has been updated else it has been deleted d o deleting link from graphic view links remove vl visiblelinks remove vl defaultlinks cleanup selectedlinks remove vl set view dirty
a dirty link is one that has been changed modified created or deleted
public string get save pathname return gvc get save pathname
returns the absolute pathname where this model should be saved
public image table get image table return it
returns the image table for this graphic view
public rectangle get view bounds return viewbounds we are not currently caching the viewbounds we will do so iff it will significantly improve speed instead we recalculate viewbounds new rectangle 0 0 0 0 iterator i get all elements iterator while i has next graphic view element ve graphic view element i next extend view bounds ve get dirty bounds extend view bounds displaybounds viewbounds viewbounds union displaybounds return viewbounds
returns the rectangle delimiting this graphic view
public void set view bounds rectangle vb d o why are we calling set view bounds d o new exception set view bounds called
sets the current viewbounds
public rectangle get display bounds return displaybounds
returns the rectangle delimiting the visible portion of this graphic view
public void set display bounds rectangle db displaybounds db set view dirty refresh visible
sets the rectangle representing the area shown in the window
private void set clicked p point p clickedp p
saves the clicked point
private point get clicked p return clickedp
recovers the clicked point
public void deselect all d o deselecting all iterator i selectedelements iterator while i has next mark dirty graphic view element i next get selectable bounds selectedelements clear i selectedlinks iterator while i has next mark dirty graphic view link i next get selectable bounds selectedlinks clear
clears all selections elements links and anything else
public view context generate context point p view graphic location gl null graphic view object gvo null if p null gl new view graphic location gl set point p gvo find object p return new view context gl gvo get selected objects
returns an omecontext object for this view with p as the associated
public graphic view object find object point p graphic view object gvo null if gvo null gvo find element p if gvo null gvo find link p return gvo
returns what is at p either an element link or null
private vector sort decomposition list vector v int n v size if n 2 return v for int i 0 i n 1 i istar element ei istar element v element at i point pi point istargeometry get ei for int j i 1 j n j istar element ej istar element v element at j point pj point istargeometry get ej if pi x pj x v remove element at j v remove element at i v insert element at ej i v insert element at ei j ei ej pi pj return v
sort the decomposed goals by their horizontal geometry position from left to right
public graphic view element find element point p we iterate over the visible elements iterator i visibleelements iterator graphic view element gve null while i has next gve graphic view element i next if gve get selectable bounds contains p gve is hidden gve is expandable omedefault plugin to expand 2 return gve return null
returns any element at point p and otherwise null
public graphic view link find link point p we iterate over the visible links iterator i visiblelinks iterator graphic view link gvl null while i has next gvl graphic view link i next if gvl get selectable bounds contains p return gvl return null
returns any link at point p and otherwise null
public collection find objects rectangle r collection c find elements r c add all find links r return c
returns a collection of all objects whose centres are within the bounds
public collection find elements rectangle r d o looking for elements in r vector ll new vector iterator i visibleelements iterator graphic view element gve null while i has next gve graphic view element i next if r contains gve get centre d o found element at gve get centre ll add gve return ll
returns a collection of all elements whose centres are within the bounds
private void set mode int mode string message switch mode case normal mode set normal mode message break case get parameter set gpmode message break case twod scrolling set two dscrolling mode message break
sets the input mode for the gvc
public collection find links rectangle r vector ll new vector iterator i visiblelinks iterator graphic view link gvl null while i has next gvl graphic view link i next if r contains gvl get centre ll add gvl return ll
returns a collection of all links whose centres are within the bounds of
public graphic view element find expanded element point p iterator i get expanded elements iterator graphic view element gve null while i has next gve graphic view element i next if point is within the circle bounded by gve get expanded bounds rectangle r gve get expanded bounds point rp new point r x r width 2 r y r height 2 if rp distance sq p r width r width 4 return gve return null
returns the first expandable element whose field includes a certain
public void show dialog jdialog jd gvc show dialog jd
displays the given jdialog to the user
public void refresh visible lists aren t we deprecated refresh visible
rebuilds the visible lists based on the current display bounds and
public boolean is view dirty return viewdirty
returns whether this graphic view has been changed since the last call of
public void set view clean viewdirty false dirtyrect null
marks the view as clean
public rectangle get dirty rect return dirtyrect
returns a rectangle bounding the dirty area
public void set dirty rect rectangle r dirtyrect r
sets the area described by a rectangle that has changed
public void mark dirty rectangle r if dirtyrect null r null dirtyrect r union dirtyrect else dirtyrect r
adds the passed rectangle to our dirty area
public void set view dirty viewdirty true dirtyrect new rectangle displaybounds
marks the whole view as dirty
private gvcparameter collector get parameter collector return pcollector
returns our gvcparameter collector
public void update view refresh visible set view dirty gvc repaint
marks the view as dirty and redraws
public void hide selection
hides all selected elements and links
public void mouse pressed mouse event me d o mousepressed request focus point p view to view me get point set clicked p p initialmode get mode if initialmode get parameter get parameter collector process mouse pressed me else if initialmode normal mode on a left mouse down try to select stuff if me get modifiers input event button3 mask 0 if me get modifiers input event ctrl mask 0 select p else if initialmode twod scrolling
processes mouse pressed event
public void show selection
un hides the elements represented by all the tokens within the current
public void mouse released mouse event me dragging false sneaky optimization stuff if wasdragging wasdragging false antialias true repaint if we were doing the selection box thing and the user let go we should finish up the selection box if selectionbox null point p view to view me get point selectionbox finish p if get mode twod scrolling gframe gvc end two dscrolling
we repaint the
public void show hidden
un hides all the hidden elements
public point to view point p return new point p x displaybounds x p y displaybounds y
translates a point from display coordinate to view coordinate
public point to display point p return new point p x displaybounds x p y displaybounds y
translates a point from view coordinate to display coordinate
public collection get child links graphic view element gve vector ll new vector if gve is expandable we re done else iterator children gve get children iterator while children has next graphic view object curr graphic view object children next iterator i curr get links iterator while i has next graphic view link gvl graphic view link i next if ll contains gvl ll add gvl return ll
returns an iterator of all of our childrens links
private rectangle get links bounds graphic view object gvo rectangle r gvo get dirty bounds iterator links gvo get links iterator while links has next graphic view link l graphic view link links next r add get links bounds l return r
recursively finds the bounds of all links attached to the given object
public void save model to xml telos model model file f try prepare the goalmodel model output to xml f catch exception e e print stack trace
save to the wbi process model
public void action performed action event e if we have a toggle button and the button is currently not selected then the user has unselected it and we should cancel the method if togglebutton null togglebutton is selected d o cancelling method for togglebutton get parameter collector cancel method else view context c view generate context p gvc get parameter collector start collecting method c togglebutton
process the menu and tool bar events
private void extend view bounds rectangle r if we move out of the current bounds we then grow the bounds by a few hundred int m 50 rectangle rplusm new rectangle r x m r y m r width m m r height m m viewbounds viewbounds union new rectangle rplusm set view dirty
grow the current viewbounds to include the passed rectangle plus a
public void key pressed key event e char c e get key char if c key event vk enter if c key event vk escape if boxclosed false undo add edit new rename edit gve get name gve set name tf get text boxclosed true gvc request focus close box tf
processes key pressed event
public void focus lost focus event e we want to die when we lose internal focus but not when the app loses focus if e get id focus event focus lost e is temporary if boxclosed false gvo set name tf get text boxclosed true gvc request focus close box tf
process the focus lost event
public void key pressed key event e char c e get key char if c key event vk enter if boxclosed false dimension p gvc view match tf get text if p null view get display bounds x p width view get display bounds width 2 view get display bounds y p height view get display bounds height 2 adjust scroll bar boxclosed true gvc request focus close box tf
processes key pressed event
public void focus lost focus event e if e get id focus event focus lost e is temporary if boxclosed false boxclosed true gvc request focus close box tf
process the focus lost event
public void key pressed key event e char c e get key char if c key event vk enter try if boxclosed false double d new double tf get text gve set scale d double value boxclosed true gvc remove tf catch number format exception nfe beep tf set text gve get scale tf select all finally gvc repaint d o voodoo
handle a key pressed event
public rectangle get bounds rectangle r new rectangle start corner r add active corner return r
what are the bounds of the box
public void finish point active corner selectionbox null destroy the reference to the box this active corner active corner iterator i view find objects get bounds iterator while i has next graphic view object gvo graphic view object i next gvo set selected true view select object graphic view object i next
selects the objects within the bounds of the box and lazily
public void update point active corner this active corner active corner
updates the active corner of the box
public boolean pastable pasting elements get elements in clipboard pasting links get links in clipboard boolean no paste elemt null pasting elements pasting elements is empty boolean no paste link null pasting links pasting links is empty return no paste elemt no paste link
get current obj in clipboard if none
public int print graphics g page format f int pi throws printer exception if pi 1 return printable no such page draw graphics2 d g return printable page exists
to print the component
public currency get currency return currency
begin user doc
public resource create resource uri uri xmlresource result new schema1 resource impl uri result get default save options put xmlresource option extended meta data boolean true result get default load options put xmlresource option extended meta data boolean true result get default save options put xmlresource option schema location boolean true result get default save options put xmlresource option use encoded attribute style boolean true result get default load options put xmlresource option use lexical handler boolean true return result
creates an instance of the resource
protected epackage get epackage return schema1 package e instance
returns the package of this validator switch
class copy method extends abstract plugin method public copy method view view
the method to copy an object
private class human intervention reasoning method extends abstract plugin method view view public human intervention reasoning method view v
bottom up reasoning method
public collection get children features object object if children features null super get children features object children features add schema1 package e instance get organization units type organization unit return children features
this specifies how to implement
public object get image object object return get resource locator get image full obj16 organization units type
this returns organization units type
public string get text object object return get string ui organization units type type
this returns the label text for the adapted class
public void notify changed notification notification update children notification switch notification get feature id organization units type class case schema1 package organization units type organization unit fire notify changed new viewer notification notification notification get notifier true false return super notify changed notification
this handles model notifications by calling
protected void collect new child descriptors collection new child descriptors object object super collect new child descriptors new child descriptors object new child descriptors add create child parameter schema1 package e instance get organization units type organization unit schema1 factory e instance create complex data type instance new child descriptors add create child parameter schema1 package e instance get organization units type organization unit schema1 factory e instance create bulk resource new child descriptors add create child parameter schema1 package e instance get organization units type organization unit schema1 factory e instance create individual resource
this adds to the collection of
public resource locator get resource locator return wbimodeler edit plugin instance
return the resource locator for this item providers resources
public list get property descriptors object object if item property descriptors null super get property descriptors object add name property descriptor object add domain property descriptor object return item property descriptors
this returns the property descriptors for the adapted class