input stringlengths 10 828 | output stringlengths 5 107 |
|---|---|
public void load file url datafile try shapefile new shapefile new gzipinput stream datafile open stream name datafile get file name name substring name last index of 1 name index of loaded true catch exception e system err println caught exception reading data e | method to load file contents into a shapefile object |
public void set value double new zoom double view model zoom view model get zoom double view model min zoom view model get min zoom double view model max zoom view model get max zoom double temp new zoom view model min zoom 100 0 double temp2 view model max zoom view model min zoom int new value int temp temp2 if new value slider get value slider set value new value | sets the zoom value based on a basic map view model |
public void set dbffile url datafile int column dbffile new dbffile data column dbffile load file datafile | assigns the dbffile |
public int get record count return shapefile get record count | the number of shapes in the file is returned |
public void delete annotation figure f clear selection discussion annotations view editor delete annotation f | passes deletes annotation command from my selection tool up to |
public shape arc get shape int index return shape arc shapefile get shape index | a specific shape is returned |
public void insert point at point p int i f points insert element at p i changed system out println insert point at called | insert a node at the given point |
public void repaint if background null background set size get size if views null for enumeration e views elements e has more elements layer view view layer view e next element view set size get size super repaint | overrides repaint method so that the background panel and each |
public void add dependent dependent dependent dependent support add dependent dependent | model inteface methods |
public string get attribute string integer index return dbffile get attribute string index int value | the attribute for a specific shape is returned |
public void set annotation color figure f color c discussion annotations view editor set anotation color f c | passes set annotation color command from my selection tool up |
public font get font double theta return f derive font t get rotate instance theta | returns the angled font instance associated with the provided angle |
public void set current font graphics g this f g get font | sets the current font based on a given graphics context |
public int split segment int x int y int i find segment x y if i 1 insert point at new point x y i 1 return i 1 system out println split segment called return 1 | splits the segment at the given point if a segment was hit |
public void mouse pressed mouse event evt system out println bmv mouse press if evt get click count 2 evt is popup trigger system out println bmv mouse press with click count 2 basic map view model mouse press evt | method to handle a mouse down event on the map |
public void draw zoomed out road labels graphics graphics system out println draw zoomed out called draw label graphics labels get zoomed out | method to draw roads labels at most zoomed out view |
public void draw major road labels graphics graphics system out println draw major called draw label graphics labels get major | method to draw major road labels |
public void draw less major road labels graphics graphics system out println draw minor called draw label graphics labels get minor | method to draw minor road labels |
public void mouse dragged mouse event evt basic map view model drag evt | method to hand a mouse dragged in the map area |
public void detach annotation a for int i 0 i comments get size i string list item sli string list item comments get item at i comment c comment table get sli c detach annotation a try replication manager get instance stop sharing comments client client delete object client get object id comments catch exception e e print stack trace | removes all comments from the list but does not delete |
public void draw label graphics graphics vector v for int i 0 i v size i road label label road label v element at i coordinate position new coordinate label position view model transform point m u position point p view model transform point u p position graphics set font altered font afont get font label angle graphics draw string label name p x p y | generic method to draw labels |
public discussion replicated object client client object id id discussion data new discussion data client id | construtor to handle the case where shared map already exists and |
public discussion view get view return discussion view | returns a pointer to the discussion view |
public discussion view create view my basic map basic map discussion view new discussion view discussion data basic map basic map get view model add dependent discussion view return discussion view | creates the view of the discussion laying out the map comments |
public void add annotation annotation a index new integer index int value 1 if a null system out println aa a null table put a get drawing a system out println abstract annotations annotation added to table annotations add figure a get drawing index system out println discussion annotations annotation added a get drawing system out println discussion annotations annotation added a | adds an new annotation |
public void remove discussion data remove | wrapper around the remove method |
public object id get object id return discussion data get object id | wrapper around the get object id method |
public int size return annotations figure count | returns number of annotations |
public void component resized component event evt system out println basic map view component resized called new size get size basic map view model set size get size | invoked when component has been resized |
public void set size dimension new size if new size display size this display size new size int minimum dimension if new size width new size height minimum dimension new size width else minimum dimension new size height map center new point minimum dimension 2 minimum dimension 2 display center new point new size width 2 new size height 2 update dependents display center | method to update model based on a resizing of the map |
public void display all annotations comment comment all annotations view a new all annotations view comment basic map a update map view | causes the map to adjust so that all the annotations associated |
public void detach annotation a figure f a get drawing table remove f annotations remove figure f | removes an annotation from the list without deleting it |
public void draw links comment c point p link view new comment link view c p dav basic map get view model this link view set size layered pane get preferred size layered pane add link view new integer 2 | draws the links between a comment and its annotations |
public point point at int i basic map view model view model coordinate c new coordinate coordinate f points element at i view model transform point m u c point p view model transform point u p c return p | returns the awt coordiantes of a point based on the view model used |
public void erase links layered pane remove link view repaint | removes the links drawn between a comment and its annotations |
public void remove annotation figure f annotation a annotation table get f table remove f system out println abstract annotations annotation remove called a remove a null system out println abstract annotations remove figure called annotations remove figure f | removes an annotation from the list and deletes it |
public void set owner generic character user this owner user string map item smi new string map item owner get user identifier map put new string map item owner smi | sets the owner of the discussion |
public point translate davpoint point dav point system out println dv annotation point dav point point p new point p x dav point x dcv get width basic map get zoom control get width p y dav point y return p | translates a point from discussion annotation view coordinates to |
public figure find figure int x int y basic map view model view model figure enumeration k figures reverse while k has more elements figure figure k next figure if figure instanceof my poly line figure system out println my standard drawing figure instanceof my poly line figure if my poly line figure figure contains point x y view model return figure return null | finds a top level figure |
public object id get object id return client get object id annotations | method to return the object id of the shared data object |
public generic character get owner string map item smi string map item map get new string map item owner return generic character get character smi to string | method to get the owner of the discussion |
public void link annotations discussion annotations d annotations this d annotations d annotations string map item smi string map item map get new string map item ann object id id object id from string smi to string annotations new annotation list client id d annotations | initializes the annotation list with annotation objects previously |
public void start link annotation a point p point scaled translate davpoint p link tool new link tool this a scaled dcv map view link tool set size layered pane get preferred size dcv set link tool link tool layered pane add link tool new integer 1 | initiates linking process creating the link tool and adding it to the |
public boolean contains this point int x int y basic map view model view model system out println my standard drawing contains this point called boolean result false figure enumeration k figures reverse while k has more elements figure figure k next figure if my poly line figure figure contains point x y view model result true break return result | checks if a point is inside the figure |
public dimension get size return display size | returns size of display area |
public void detach try replication manager get instance stop sharing annotations client client delete object client get object id annotations catch exception e e print stack trace | removes all the annotations from the list without deleting |
public object id get object id return client get object id map | method to return the object id of the shared data object |
public void set text string text generic character user this owner user string map item smi new string map item owner get user identifier map put new string map item owner smi this text text smi new string map item text map put new string map item text smi this timestamp new date smi new string map item df format timestamp map put new string map item timestamp smi | assign comment data text owner timestamp |
public void start link comment c point p link tool new link tool this c p dcv map view link tool set size layered pane get preferred size dav set link tool link tool layered pane add link tool new integer 1 | initiates linking process creating the link tool and adding it to the |
public void invalidate basic map view model view model system out println my standard drawing invalidate view model called if listener null rectangle r display box view model r grow handle handlesize handle handlesize listener figure invalidated new figure change event this r | invalidates the figure |
public boolean join segments int x int y for int i 1 i f points size 1 i point p point at i if geom length x y p x p y 3 remove point at i return true system out println join segments called return false | joins to segments into one if the given point hits a node |
public discussion comments get comments return comment list | method to return a pointer to the discussion comments object |
public void end link tool layered pane remove link tool link tool null dcv set link tool link tool dav end link repaint | ends the linking process cleaning up the display |
public void set text string text this owner generic character get local character string map item smi new string map item owner get user identifier map put new string map item owner smi this text text smi new string map item text map put new string map item text smi this timestamp new date smi new string map item df format timestamp map put new string map item timestamp smi | assign comment data text owner timestamp |
public vector handles basic map view model view model vector handles new vector for figure enumeration e figures e has more elements system out println my standard drawing examining polylinefigure figure f e next figure vector f handles my poly line figure f handles view model for enumeration k f handles elements k has more elements handles add element k next element system out println my standard drawing handles handles size return handles | returns the figures handles |
public void remove figure enumeration fe annotations figures figure figure null annotation a null while fe has more elements figure null figure fe next figure a annotation table get figure if a null a remove try replication manager get instance stop sharing annotations client client delete object client get object id annotations catch exception e e print stack trace | deletes all the shared data |
protected jtool bar create tool palette jtool bar palette new jtool bar palette set background color light gray tool tool scribble tool button new my tool button images scribbl scribble tool tool button set selected false button add mouse listener this palette add button return palette | creates the tool palette |
public void create new annotation comment comment annotation annotation dav create new annotation comment add annotation annotation annotation add comment comment | creates a new annotation and links it to a comment |
public void set zoom double new zoom if new zoom zoom this zoom new zoom update dependents new double zoom | method to update model based on zoom changing |
public void add annotation annotation a system out println comment add annotation called if annotations size 0 update dependents a annotations add annotation a system out println comment text attached to a | adds an annotation |
public void remove try comment list remove annotations remove replication manager get instance stop sharing map client client delete object client get object id map catch exception e e print stack trace | delete the shared data |
public void start link figure f point p annotation a annotations get annotation f parent start link a p | passes start link command from my standard drawing view up to |
public void set comment comment comment this comment comment comment add annotation annotation annotation add comment comment view end link tool | assigns a comment to a previously selected annotation |
public boolean draw translation graphics g boolean drawn true drawn figures remove all elements g set color color get attribute color system out println my standard drawing graphics color color get attribute color figure enumeration k figures while k has more elements figure f k next figure if f instanceof my poly line figure if my poly line figure f draw g drawn figures add element f drawn false return drawn | overrides the draw routine in composite figure to handle |
public void end link link tool null f view clear selection repaint | passes end link command from discussion view down to |
public void set annotation annotation annotation this annotation annotation comment add annotation annotation annotation add comment comment view end link tool | assigns an annotation to a previously selected comment |
public void highlight translation graphics g g set color color light gray figure enumeration k figures while k has more elements my poly line figure k next figure highlight g | highlights this figure |
public void link current annotation vector selection f view selection if selection size 0 my standard drawing figure figure my standard drawing selection element at 0 link tool set annotation annotations get annotation figure else link tool cancel | links the currently selected annotation to a comment by passing |
public void cancel view end link tool | cancels the linking interaction |
public void set map focus int x int y point p new point x y coordinate c transform point p u p transform point u m c update the current focus coordinate set map focus c x c y | updates model with new focus based on a pixel coordinate |
public generic character get owner return owner | method to retrieve owner |
public void paint component graphics g if end point null system out println link tool start point start point x start point y system out println link tool end point end point x end point y g draw line start point x start point y end point x end point y | draws the connector line between comments and annotations |
public void add comment comment c comments add comment c system out println annotation this attached to c get text | associates a comment with this annotation |
public void remove comments detach this | deletes shared data |
public annotation create new annotation button mouse pressed new mouse event button 0 0 0 0 0 1 false mouse clicked new mouse event button 0 0 0 0 0 1 false return temp drawing | initiates drawing a new annotation that is to be linked to an |
public void set map focus double x double y if x map focus x y map focus y map focus x x map focus y y update dependents map focus | updates model with new focus based on map coordinates |
public void detach annotation annotation a annotations detach a if annotations size 0 update dependents | detaches an annotation |
public int annotation count return annotations size | returns annotation count |
public void recenter map focus double width map bounds 2 map bounds 0 double height map bounds 3 map bounds 1 map focus new coordinate width 2 0 map bounds 0 height 2 0 map bounds 1 update dependents map focus | updates model with new focus in center of map coordinates |
public annotation list get annotations return annotations | returns the annotations |
public void delete annotation figure f annotations remove annotation f f drawing annotations get current drawing f view set drawing f drawing | passes delete annotation command from my standard drawing view to |
public void set tool tip support boolean b this look up b | updates model to use tool tip support or not |
public void remove annotations detach try replication manager get instance stop sharing map client client delete object client get object id map catch exception e e print stack trace | method for removing the shared data |
public void clear selection f view clear selection | wrapper around clear selection method of my standard drawing view |
public boolean is tool tip support return look up | determines if tool tip support is used |
public void set start date date start date object old this start date this start date start date fire property change start date old start date | sets the start date for the timeline |
public int find segment int x int y point p1 p2 for int i 0 i f points size 1 i p1 point f points element at i p2 point f points element at i 1 if geom line contains point p1 x p1 y p2 x p2 y x y return i system out println find segment called return 1 | gets the segment of the polyline that is hit by |
public void set embedded object descriptor embedded object descriptor desc document info set embedded object descriptor desc | sets the descriptor to be shown in the document info panel |
public void set end date date end date object old this end date this end date end date fire property change end date old end date | sets the end date for the timeline |
public int get announcement cycle time return announcement cycle time | returns the number of seconds between announcements |
public announcement panel get announcement panel return announcements | returns the announcment panel |
public void set announcement cycle time int announcement cycle time if announcement cycle time this announcement cycle time announcement cycle time math max 1 announcement cycle time int old this announcement cycle time this announcement cycle time announcement cycle time fire property change announcement cycle time old announcement cycle time | sets the number of seconds between announcements |
public int get document cycle time return document cycle time | returns the number of seconds between auto selected documents |
public void set document cycle time int document cycle time if document cycle time this document cycle time document cycle time math max 1 document cycle time int old this document cycle time this document cycle time document cycle time fire property change document cycle time old document cycle time | sets the number of seconds between auto selected documents |
public int get revert to default time return revert to default time | returns the number of seconds before the display reverts to its default |
public void set revert to default time int revert to default time if revert to default time this revert to default time revert to default time math max 1 revert to default time int old this revert to default time this revert to default time revert to default time fire property change revert to default time old revert to default time | sets the number of seconds before the display reverts to its default |
public string get subgroup patterns return subgroup patterns | returns a comma delimited list of string patterns that will be used |
public void set subgroup patterns string subgroup patterns object old this subgroup patterns this subgroup patterns subgroup patterns fire property change subgroup patterns old subgroup patterns | sets a comma delimited list of string patterns that will be used |
public string get announcement paths return announcement paths | returns a comma delimited list of paths to text objects that should |
public void compute threshold threshold maxdistance mindistance zoom zoomed out zoomed in zoomed out mindistance | method to compute the threshold allowed between a cursor and shape |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.