input
stringlengths
10
828
output
stringlengths
5
107
public void set window document title resource r string doc title model old m null if prefs contains r lal document name if prefs contains r lal document name doc title return old m new model mem r prefs get resource r get uri stmt iterator iter r list properties lal document name while iter has next old m add iter next statement model m new model mem m add r lal document name doc title prefs change temporary old m m xxx really this should be in a preference listener reset window title r
sets the title of the document window to reflect the name of the
public double get box width return bbox width
cant use get width since pnode already defines it
public double get box height return bbox height
cant use get width since pnode already defines it
public void set center bolded boolean b center bolded b rehighlight
turns on off the center highlight indicating the middle of the box
protected void interpret modifiers pinput event e boolean ctrl pressed 0 e get modifiers ex input event ctrl down mask boolean shift pressed 0 e get modifiers ex input event shift down mask set drawn from center default draw from center ctrl pressed ctrl pressed set constraining aspect ratio default constrain aspect ratio shift pressed shift pressed
checks to see if the event has the ctrl mask
public void clear point2 d blank new point2 d 1 blank 0 new point2 d double highlight line set path to polyline blank highlight circle set path to polyline blank if center bolded false try to avoid flickering highlight center set path to polyline blank reset style
makes all bolding blank so it doesnt highlight
public void set window modified resource r boolean val final model m new model mem m add r lal document modified val model old m null prefs enter critical section model lock read try if prefs contains r lal document modified if prefs contains r lal document modified val return old m new model mem old m add r lal document modified val finally prefs leave critical section prefs change temporary old m m xxx really this should be in a preference listener reset window title r
sets the window modified field of the given frame
private void constrain new size double new size guarantees minimum height and width if new size 0 min width new size 0 min width if new size 1 min height new size 1 min height if is constraining aspect ratio double width ratio new size 0 orig width double height ratio new size 1 orig height if width ratio height ratio new size 0 orig width height ratio else new size 1 orig height width ratio
applies minimum width and aspect ratio constraints
protected void reset style highlight circle set stroke get highlight display properties get stroke highlight circle set stroke paint get highlight display properties get stroke paint this set stroke get display properties get stroke this set stroke paint get display properties get stroke paint
updates the strokes to the latest version of the display property
public double min dist point2 d select int start point curr pts length 1 double min double positive infinity for int end point 0 end point curr pts length end point line2 d test new line2 d double curr pts start point curr pts end point min math min min test pt seg dist select start point end point return min
gets the distance from the selection point to the edge of the box
public double get box width return obox width
cant use get width since pnode already defines it
public double get box height return obox height
cant use get width since pnode already defines it
private boolean is beneath top edge of obox point2 d drag point line2 d line new line2 d double obox pts 0 obox pts 1 int dir line2 d relative ccw obox pts 0 get x obox pts 0 get y obox pts 1 get x obox pts 1 get y drag point get x drag point get y return dir 1 true false
is the drag point beneath the top edge of the obox
public double get obox width return obox width
cant use get width since pnode already defines it
public double get obox height return obox height
cant use get width since pnode already defines it
protected void verify ctrl is pressed pinput event e boolean ctrl pressed 0 e get modifiers ex input event ctrl down mask set drawn from center ctrl pressed default draw from center ctrl pressed default draw from center
checks to see if the event has the ctrl mask
private boolean is beneath top edge of obox point2 d drag point line2 d line new line2 d double ellipse pts 0 ellipse pts 1 int dir line2 d relative ccw ellipse pts 0 get x ellipse pts 0 get y ellipse pts 1 get x ellipse pts 1 get y drag point get x drag point get y return dir 1 true false
is the drag point beneath the top edge of the obox
public void unbold point2 d blank new point2 d 1 blank 0 new point2 d double highlight line set path to polyline blank highlight circle set path to polyline blank highlight interior set path to polyline blank
makes all bolding blank so it doesnt highlight
public void remove bounding box point2 d blank new point2 d 1 blank 0 new point2 d double bounding box set path to polyline blank handle set path to polyline blank
used when making box inactive so only ellipse shows
public void add bounding box update obox part update handle part
used when making box active so only ellipse shows
public void unbold highlight line set path to polyline blank highlight circle set path to polyline blank highlight interior set path to polyline blank unbold handle
makes all bolding blank so it doesnt highlight
public viper table model get current model table model mod get table null null get table get model if mod instanceof viper table model return viper table model get table get model else return null
get the model of the currently selected table since a vipertable may
public void set edit click count int edit click count this edit click count edit click count
sets the edit click count
private jsplit pane get jsplit pane if j split pane null j split pane new jsplit pane j split pane set preferred size new java awt dimension 650 400 j split pane set right component jpanel j panel map values iterator next j split pane set left component get jscroll pane return j split pane
this method initializes j split pane
private jscroll pane get jscroll pane if j scroll pane null j scroll pane new jscroll pane j scroll pane set preferred size new java awt dimension 125 3 j scroll pane set viewport view get jlist return j scroll pane
this method initializes j scroll pane
private jlist get jlist if j list null j list new jlist j list set model get default list model j list add list selection listener new javax swing event list selection listener public void value changed javax swing event list selection event e jpanel panel jpanel j panel map get default list model get j list get selected index to string j split pane set right component panel return j list
this method initializes j list
private default list model get default list model if default list model null default list model new default list model for iterator iter j panel map key set iterator iter has next default list model add element iter next return default list model
this method initializes default list model
private iterator what should be showing viper view mediator mediator get mediator sourcefile sf mediator null null mediator get curr file if sf null return collections empty list iterator else if mediator is showing invalid cfg get desc type config file return sf get descriptors by cfg else instant now get mediator get major moment return sf get descriptors by cfg now
get the descriptors this table should be showing
private jcheck box get jcheck box use index file if j check box use index file null j check box use index file new jcheck box j check box use index file add action listener new java awt event action listener public void action performed java awt event action event e if mediator null mediator get prefs navigator set index file loading j check box use index file is selected if mediator null j check box use index file set selected mediator get prefs navigator using index file loading return j check box use index file
this method initializes j check box use index file
public jdialog get jdialog if j dialog null if mediator null j dialog new jdialog mediator get prefs get core preferences else j dialog new jdialog j dialog set default close operation javax swing window constants dispose on close j dialog set maximum size new java awt dimension 656 425 j dialog set minimum size new java awt dimension 656 425 j dialog set bounds new java awt rectangle 0 0 656 425 j dialog set content pane get jsplit pane j dialog set resizable false j dialog set title preferences return j dialog
this method initializes j dialog
private jlabel get jlabel navigation panel if j label navigation panel null j label navigation panel new jlabel j label navigation panel set text describes the action vi per takes when the arrow keys are used to select a descriptor or attribute return j label navigation panel
this method initializes j dialog
private jradio button get radio no jump if radio no jump null radio no jump new jradio button radio no jump set text do not jump video decoder on descriptor or attribute selection radio no jump put client property radio property new integer viper prefs navigator no jump int to button map put new integer viper prefs navigator no jump radio no jump radio no jump add action listener new java awt event action listener public void action performed java awt event action event e radio button changed radio no jump return radio no jump
this method initializes radio no jump
public window get container return container
gets the containing window
public void set container window frame container frame
sets the containing window
public viper change event get viper event return viper event
gets the viper event that caused this change
public void toggle visibility int tab if tab 0 tab this tabs get tab count throw new illegal argument exception not a valid tab tab if mediator null return node visibility manager h mediator get hiders if objects at tabs tab null int visibility h get type visibility config content h set visibility by type config content visibility 2 3 else int old visibility h get config visibility objects at tabs tab int new visibility node visibility manager rotate visibility old visibility h set visibility by config objects at tabs tab new visibility
toggle visibility on the specified tab
public boolean using index file loading if mediator null prefs mediator get prefs if prefs contains gt gt preferences gt use index files model to add new model mem to add add gt gt preferences gt use index files true prefs change user null to add return prefs get property gt gt preferences gt use index files get boolean
tells whether or not indices are currently being used for loading
public void set jump on selection int int resource if mediator null prefs mediator get prefs model to add new model mem model to remove null prefs enter critical section model lock read try if prefs contains gt gt preferences gt jump on selection property to remove new model mem statement stmt prefs get property gt gt preferences gt jump on selection property to remove add stmt finally prefs leave critical section to add add gt gt preferences gt jump on selection property resource int to resource map get new integer int resource prefs change user to remove to add
sets the preference that indicates whether and how to jump on descriptor selection
public int get jump on selection if mediator null prefs mediator get prefs if prefs contains gt gt preferences gt jump on selection property model to add new model mem to add add gt gt preferences gt jump on selection property gt no jump resource prefs change user null to add return integer resource to int map get prefs get property gt gt preferences gt jump on selection property get object int value
tells the current setting for jumping on selection
public void state changed change event e iterator iter mediator get selection get selection beneath mediator get selection get root if iter has next table key event object obj iter next if obj instanceof descriptor descriptor desc descriptor obj jump on descriptor desc else if obj instanceof attribute attribute attr attribute obj jump on attribute attr
jumps the viewer on the node according the the currently specified preferences
public void jump to next valid frame descriptor descriptor instant new frame instant descriptor get valid range first after mediator get major moment if new frame null mediator set major moment new frame
jumps the viewer to the next valid frame of the descriptor
public void jump to next valid frame attribute attr instant new frame instant attr get range first after mediator get major moment if new frame null mediator set major moment new frame
jumps the viewer to the next valid frame of the descriptor
public void jump to prev valid frame descriptor descriptor if descriptor get valid range contains mediator get major moment previous mediator set major moment instant mediator get major moment previous return instant new frame instant descriptor get valid range first before mediator get major moment instant new frame instant descriptor get valid range first before or at mediator get major moment new frame end of interval containing new frame descriptor get valid range if new frame null mediator set major moment new frame
jumps the viewer to the prev valid frame of the descriptor
public void jump to prev valid frame attribute attr if attr get range contains mediator get major moment previous mediator set major moment instant mediator get major moment previous return instant new frame instant attr get range first before or at mediator get major moment instant new frame instant attr get range first before mediator get major moment new frame end of interval containing new frame attr get range if new frame null mediator set major moment new frame
jumps the viewer to the prev valid frame of the attribute
public void jump to first valid frame descriptor descriptor instant new frame instant descriptor get valid range get extrema get start if new frame null mediator set major moment new frame
jumps the viewer to the first valid frame of the descriptor
public void jump to first valid frame attribute attr instant new frame instant attr get range get extrema get start if new frame null mediator set major moment new frame
jumps the viewer to the prev valid frame of the attribute
public void jump to last valid frame descriptor descriptor instant new frame instant descriptor get valid range get extrema get end new frame instant new frame previous if new frame null mediator set major moment new frame
jumps the viewer to the last valid frame of the descriptor
public void jump to last valid frame attribute attr instant new frame instant attr get range get extrema get end new frame instant new frame previous if new frame null mediator set major moment new frame
jumps the viewer to the last valid frame of the attribute
public viper view mediator get mediator return mediator
gets the viper ui mediator the script manager should link with
public void set mediator viper view mediator mediator this mediator mediator if first call done event queue invoke later new runnable public void run reset script menu else event queue invoke later new runnable public void run swing worker new swing worker public object construct reset script menu return null swing worker start
sets the viper ui mediator the script manager should link with
private int find num frames file file system gc mpeg test mpeg test new mpeg test file get absolute path return mpeg test get num frames
finds the number of frames in the mpeg movie pointed to by file
public void pause if possible viper view mediator m layer get mediator if m null m get play controller null m get play controller human pause
this method pauses the mediator if possible and
private void add menu tree from resource resource menu node model m if menu node has property rdf type menu item else if menu node has property rdf type menu group menu node has property rdf type menu menu res iterator kids menu node get model list subjects with property menu attachment menu node while kids has next add menu tree from resource kids next resource m stmt iterator item desc menu node list properties m add item desc
adds the menu that menu node represents to the model m
public void set parent resource resource parent resource this parent resource parent resource
sets the uri that this bean is attached to
public void action performed action event e try app loader script app script cache get script new uri e get action command if app script null throw new runtime exception cannot load script e get action command app script run mediator get prefs get core catch urisyntax exception e2 logger severe misregistered script e get action command
runs the script found specified in the action command string
public viper data factory get data factory return vp get type factory
gets the type factory used for associating data types with attributes
public interpolator get interpolator for type string type return interpolator interpolators get type
get the interpolation function object for the given data type
private string fix one data string data string framespan get framespan data string fixed framespan fix framespan framespan if fixed framespan equals return return data replace first framespan fixed framespan
takes one data object in the form data
public void stop asst switch listener switch from creator to editor asst remove shape
when the canvas loses focus the shape should be cancelled
public void set data factory viper data factory fact vp set type factory fact
sets the attribute type factory
private string get framespan string str int begin str index of framespan if begin 1 return int end str index of begin 10 if end 1 return return str substring begin end 2
finds and returns the first section of str that matches framespan
public void set mediator viper view mediator mediator this mediator mediator
the mediator is required for set attribute method and for making sure
public instant get instant if current instant null return current instant if mediator null return mediator get major moment return null
if this is non null then this is used as the current instant
public void set instant instant i this current instant i
to use the mediators major moment set to null
public uri get file name return backing file
gets the uri of the currently displayed metadata file
public void set live edit lock live edit locked true
this lock is used while frames are changing as editing
public void release live edit lock live edit locked false
indicate that it is okay to recycle the current editor when a frame
public boolean is live edit locked return live edit locked
tests to see if the live edit lock is set
public void set unit preference class unit preference this unit preference unit preference
sets the preferred unit of time
public config insert iframe descriptor config viper data v mediator get viper data config c v get config config object descriptor name if c null c v create config config object descriptor name return c
creates a new type of descriptor called i frames
public void start propagating attribute attr if propagating descriptors contains attr get parent propagating attributes add attr explicit attributes add attr else explicit attributes remove attr
stops the attribute from propagating even if its descriptor is
public void stop propagating attribute attr propagating attributes remove attr if propagating descriptors contains attr get parent explicit attributes add attr
starts the attribute propagating even if its descriptor is not
public window get container return dialog
gets the finding file dialog associated with this worker thread
public void set path box information box set path textline model box
dummy wrapper method so that set path from pbox node is implemented
public void set container window frame dialog frame
sets the finding file dialog associated with this worker thread
protected boolean verify ctrl is pressed pinput event e boolean ctrl down e get modifiers ex input event ctrl down mask 0 set drawn from center ctrl down default draw from center ctrl down default draw from center return ctrl down
checks to see if the event has the ctrl mask
public int get nearest boundary handle point2 d p int ret 1 list iterator li offset lines get children iterator for int i 0 li has next i if word boundary node li next handle contains p ret i return ret
determines whether the given point is near any boundary handle
public uri get local path to file uri canonical get prefs enter critical section model lock read try resource r get prefs get resource canonical to string if r has property gt file location r r get property gt file location get resource try return new uri r to string catch urisyntax exception e throw new runtime exception e return canonical finally get prefs leave critical section
finds the local version of the file
public void update word offset at index int index int value integer off new integer value important must set the index in orig copy not in changed copy orig copy get word offsets set index off
updates the specified word offset
public void hide ghost ghost boundary set path to polyline blank
hides the ghost boundary
public textline model get model return orig copy
getter for the model of this textline node
public void add viper mediator change listener viper mediator change listener l listeners add viper mediator change listener class l
adds a listener for ui notifications
public void add editor canvas editor e if e null editors add e
add editor object to current frame
public void add shape pnode node shape drawn node metadata node add child node
adds shape to canvas so you can see and edit it
public void remove viper mediator change listener viper mediator change listener l listeners remove viper mediator change listener class l
removes a listener
public void set attr config attr config ac attr config ac
sets the attr config value
public void fire media change object l listeners get listener list viper mediator change event eo null for int i l length 2 i 0 i 2 if l i viper mediator change listener class if eo null eo new viper mediator change event this viper mediator change listener l i 1 media changed eo
indicate that the underlying media has changed although the metadata has
public play controller get play controller return vc
gets the playback controller
public void set model and refresh textline model tlm viper view mediator med attribute attr model tlm mediator med attrib attr set text tlm get text null display all existing occlusions array list occlusions tlm get occlusions for int i 0 i occlusions size i int pair ip int pair occlusions get i occlude range ip get one 1 ip get two 2 true slst action performed null force a show
refreshes the editor based on a new textline model
public void set text string text m editor set text text
sets the text of the editor
public void fire curr file change object l listeners get listener list viper mediator change event eo null for int i l length 2 i 0 i 2 if l i viper mediator change listener class if eo null eo new viper mediator change event this viper mediator change listener l i 1 curr file changed eo
indicate that the currently selected sourcefile is no longer selected
public void add word offset int offset word offsets add new integer offset
adds a new word offset
public void occlude range int x start int x finish boolean on mutable attribute set attr new simple attribute set style constants set bold attr on if x start x finish m doc set character attributes x start x finish x start attr false
occludes the range x start x finish
public boolean remove word offset int offset int i word offsets index of new integer offset if i 1 word offsets remove i return true else return false
removes the given offset from the list first match only
public void add occlusion int start int end occlusions add new int pair start end
adds a new occlusion pair convenience method for two ints
public action get decelerate action return decelerate action
gets ab action listener that slows down playback or speeds up reverse
public void fire frame change object l listeners get listener list viper mediator change event eo null for int i l length 2 i 0 i 2 if l i viper mediator change listener class if eo null eo new viper mediator change event this viper mediator change listener l i 1 frame changed eo
indicate that the there is a new current frame of interest
public void add occlusion int pair occl occlusions add occl
adds a new occlusion pair
public boolean remove occlusion int pair occl int i occlusions index of occl if i 1 occlusions remove i return true else return false
removes the given occlusion from the list first match only
public void set int x int y int width int height int rotation obox set x y width height rotation
directly change the value of this textbox