input
stringlengths
10
828
output
stringlengths
5
107
public void highlight node graphics g object node point loc draw node g node loc true
draws the node into the graphics context in a highlighted fashion
public boolean pick node object node point node loc point pick point return node loc null false math abs pick point x node loc x 25 math abs pick point y node loc y 15
checks whether the specified pick point is within the drawn area for the
public jcomponent get component object node return components get node
gets the component used to draw a particular node
public void set color color node color color node color
sets the color for the node renderer
public object get node jcomponent comp object node null for object key node components key set if comp equals components get key node node key node return node
gets the node associated with a given swing component
public void set shape node shape node shape shape node shape
set the shape used to display the nodes
public rectangle get node bounds object node point loc rectangle rect null jcomponent comp components get node if comp null rect comp get bounds rect return rect
returns the bounding box for the node using this renderer
public void draw edge graphics g object edge point orig loc point dest loc boolean display true if edge instanceof sequential if active or there are no time spans at all display display sequential edge is active now sequential edge get time spans is empty if display sub render draw edge g edge orig loc dest loc
draws the edge into the graphics context
public boolean get use swing colors return use swing colors
gets the flag indicating whether this renderer should use the native
public date get cur time return now
returns the time used by the renderer to render the edges
public int get current face return current face
gets the index of the current face
public void set color color color sub render set color color
sets the color for the edge renderer
public void highlight node graphics g object node point loc draw node g node loc jcomponent comp components get node comp request focus in window
highlights the node into the graphics context
public void set cur time date time now time
sets the time used by the renderer to render the edges
protected boolean check node time object node date cur time boolean display true if node instanceof sequential if active or there are no time spans at all display display sequential node is active now sequential node get time spans is empty return display
return whether the node should be displayed at the given time
public boolean pick node object node point loc point pick point rectangle rect get node bounds node loc return rect null rect contains pick point
checks whether the specified pickpoint is within the drawn area for the
public void draw node graphics g object node point loc double fade frac determine fade factor node now if fade frac 0 we have a visible node color color get color int alpha int fade frac 255 color faded fade frac 1 0 color new color color get red color get green color get blue alpha sub render set color faded sub render draw node g node loc sub render set color color
draws the node in the graphics context provided
public void set color color color node color color
sets the color for the node renderer
public void set template jcomponent template node template template get class for jcomponent comp components values cont remove comp components clear
sets the template
public long get fade time return fade in
returns the fade time
protected image get image int face return bg image
get the image associated with the specified face
public void set use swing colors boolean flag use swing colors flag
sets the flag indicating whether this renderer should use the native
public boolean pick node object node point loc point pick point should add in time check return sub render pick node node loc pick point
checks whether the specified pickpoint is within the drawn area for the
public void draw edge graphics g object edge point orig loc point dest loc color preset g get color java util list point pt list get all points edge orig loc dest loc if pt list size 0 int x points new int pt list size int y points new int pt list size int inx 0 for point point pt list x points inx point x y points inx point y inx g set color color g draw polyline x points y points inx g set color preset
draws the edge into the graphics context
public rectangle get node bounds object node point loc rectangle bounds null int size get node size node int height int size aspect if loc null bounds new rectangle loc x size loc y height 2 size int size shadow 2 height int height shadow return bounds
returns the bounding box for the node using this renderer
public void set cur time date cur time now cur time
sets the current time represented by this node renderer
public void set fade time long fade time millis fade in fade time millis
sets the fade time
protected color get node color object node return node color
get the color used for the node
public void add class renderer object sample node node renderer renderer class node class sample node get class render map put node class renderer
add a node renderer for a class of nodes
public void draw node graphics g object node point loc node renderer render find renderer node render draw node g node loc
draws the node into the graphics context
private node renderer find renderer object node class node class node get class node renderer renderer render map get node class if renderer null iterate over map to find possible superclasses class match class null for class cls render map key set if cls is instance node if match class null match class is assignable from cls second clause in this if statement identifies if match class is a superclass of cls match class cls if match class null renderer default render else renderer render map get match class return renderer
determine which renderer should be used to render the node
public color get color return default render get color
this method returns the color of the default renderer
public rectangle get node bounds object node point loc node renderer render find renderer node return render get node bounds node loc
returns the bounding box for the node using this renderer
public void highlight node graphics g object node point loc node renderer render find renderer node render highlight node g node loc
draws the node into the graphics context in a highlighted fashion
protected int get node size object node return 25
get the size used for the cube node
public boolean pick node object node point node loc point pick point node renderer render find renderer node return render pick node node node loc pick point
checks whether the specified pickpoint is within the drawn area for the
public void set color color color default render set color color
this method sets the color for the default renderer
protected image get icon object node return icon
get the icon used to render the specified node
public arrow head location get arrowhead location return head loc
gets the location of the arrowhead relative to the edge
public rectangle get node bounds object node point loc rectangle bounds null if loc null image scaled get icon node int height scaled get height this int width scaled get width this if icon scale flag if height width width width icon size height height icon size else height height icon size width width icon size int img x loc x width 2 int img y loc y height 2 bounds new rectangle img x img y width height return bounds
returns the bounding box for the node using this renderer
public int get arrowhead size return arrow size
gets the size used for the arrowhead
public void highlight node graphics g object node point loc draw node g node loc color tmp color g get color g set color node color image scaled get icon node int height scaled get height this int width scaled get width this if icon scale flag if height width width width icon size height height icon size else height height icon size width width icon size g draw rect loc x width 2 loc y height 2 width height g set color tmp color
highlights the node into the graphics context
public boolean pick node object node point loc point pick point return get node bounds node loc contains pick point
checks whether the specified pickpoint is within the drawn area for the
public void set arrowhead location arrow head location loc head loc loc
sets the location of the arrowhead relative to the edge
public void set arrowhead size int size arrow size size
sets the size used for the arrowhead
public void set icon scale flag boolean scale flag icon scale flag scale flag
sets the flag indicating whether to scale the icon or use the natural
public void set offset int pixel offset offset pixel offset
set the offset value used to render the arrowhead from the location of
public double get shadow factor return shadow
returns the shadow factor
public void set icon size int size icon size size
sets the size of icon to be used
public void draw node graphics g object node point loc if loc null color preset g get color color col get node color node g set color col g fill oval loc x size loc y size 2 size 2 size if col get red col get green col get blue 2 250 g set color color black else g set color color white string name node to string font metrics metrics g get font metrics int width metrics string width name g draw string name loc x width 2 loc y g set color preset
draws the node into the graphics context
public void set show names boolean show show names show
sets the flag indicating whether the name of the node should be
public rectangle get node bounds object node point loc rectangle bounds null if loc null bounds new rectangle loc x size loc y size 2 size 2 size return bounds
returns the bounding box for the node using this renderer
public entity type determine type string term entity type type null if specials key set contains term type entity type date time for date format fmt formats key set if use relative fmt instanceof simple date format try fmt parse term if we don t throw an exception good type entity type date time catch parse exception exc return type
determine the entity type for a particular term
public void highlight node graphics g object node point loc draw node g node loc color preset g get color color col get node color node if col get red col get green col get blue 2 250 g set color color black else g set color color white g draw oval loc x size loc y size 2 size 2 size g set color preset
highlights the node into the graphics context
public boolean pick node object node point loc point pick point boolean picked false if node null loc null picked pick point distance loc size return picked
checks whether the specified pickpoint is within the drawn area for the
public void set size int node size size node size
sets the size used to draw the node
public string normalize string term entity type type string normal null if type equals entity type date time date found normalize date term if found null normal normalized format found return normal
convert this term to a normalized date form
public boolean pick node object node point loc point pick point boolean picked false if node null loc null int size get node size node int x1 loc x size int x2 loc x int math round size size shadow int y1 loc y int math round size aspect size aspect shadow int y2 loc y int math round size aspect picked pick point y y1 pick point y y2 pick point x x1 pick point x x2 return picked
checks whether the specified pickpoint is within the drawn area for the
public void set normalized form string pattern normalized new relative date format pattern formats put normalized date time
set the normalized form to write date time entities
public void set animation flag animation flag anim flag flag
sets a flag indicating the type of transformation
public void set use relative boolean flag use relative flag
set the flag indicating whether this verifier will allow relative dates
public boolean verify type string term entity type type boolean valid specials contains key term if type equals entity type date time valid for date format fmt formats key set try fmt parse term if we don t throw an exception good valid true catch parse exception exc return valid
verify if the term matches the entity type
public void set animation step double frac anim frac frac
sets the fractional step along the animation
public void add extractor entity extractor extractor extractors add extractor
add an extractor to the set of entity extractors used by this composite
public void set aspect double aspect ratio aspect aspect ratio
sets the aspect ratio used for the boxes when drawn
public void add verifier entity verifier verifier verifiers add verifier types add all verifier get supported types
add an entity verifier to the set of entity verifiers used by this
public void set background image image image bg image image
sets the background image that is rendered on the boxes
public entity type determine type string term entity type type null for entity verifier verifier verifiers entity type new type verifier determine type term if type null new type null type equals new type else type new type return type
determine the entity type for a particular term
public string normalize string term entity type type string norm null for entity verifier verifier verifiers if verifier get supported types contains type string new norm verifier normalize term type if norm null new norm null norm equals new norm do something here else norm new norm return norm
get a normalized form for this entity and type
public void set current face int new face current face new face
sets the index of the current face
public void set document date date date for entity verifier verifier verifiers if verifier instanceof date time verifier date time verifier verifier set relative reference date relative type last
set the date to be used for documents
public entity type determine type string term string corrected string utils to initial caps term return get coordinate corrected null get real name term equals ignore case term entity type location null
determine the entity type for a particular term
public boolean verify type string term entity type type return verify entity term type 0
verify that the term matches the type
public string normalize string term return get real name string utils to initial caps term
get a normalized form for this entity
public entity type determine type string term entity type type null if bad vals contains term hash set string vals query resource term rdf type if vals is empty bad vals add term else type entity type unknown for string ont type vals if ont type equals http dbpedia org ontology place type entity type location else if ont type starts with http dbpedia org class yago person type entity type person else if ont type equals http dbpedia org ontology organisation type entity type organization return type
determine the entity type for a particular term
public string normalize string term entity type type return type equals entity type location get real name string utils to initial caps term null
get a normalized form for this entity
public string normalize string term entity type type string norm null hash set string vals query resource term dbpedia2 redirect if vals size 1 norm vals iterator next norm norm replace return norm
normalize the term to its standard form
public void set model string model string cfg arr model split boolean load false for string cfg str cfg arr cfg str cfg str trim int eq inx cfg str index of if eq inx 1 string key cfg str substring 0 eq inx string val cfg str substring eq inx 1 if key equals ignore case load val equals ignore case true load true else set geo path cfg str if load get geo path starts with http load cache
set the model for this verifier
public void set model string model
set the model for this accessor
public boolean verify type string term entity type type boolean valid false if type equals entity type location string corrected string utils to initial caps term geo object obj get geo object string utils to initial caps corrected valid obj null obj get alt names contains corrected return valid
verify if the term matches the entity type
public boolean verify type string term entity type type entity type good determine type term return good null good equals type
verify that the term matches the type
public void set shadow factor double shadow factor shadow shadow factor
sets the amount the shadow the side face extends beyond the side of
private string format digits long num string buffer buf new string buffer long hundreds num 100 long low num 100 if hundreds 0 buf append number lookup hundreds numbers buf append hundred if low 20 low 0 buf append number lookup low numbers else if low 20 low 0 long ten val low 10 10 long units low 10 buf append number lookup ten val tens if units 0 buf append buf append number lookup units numbers return buf to string
format digits under a thousand
private string number lookup long val hash map string long map string word null for string term map key set if val map get term long value word term return word
get the text matching the number from the specified table
public date get reference date return ref date
get the date that this date format uses as a reference
public string get phrase object return object
get the object of the phrase
public long get offset return offs
get the offset for this data entry
public void add entities set string entity set entities add all entity set
add known entities to allow the phrase finder to treat these as
private string build sentence list part of speech tag tag list string buffer sent buf new string buffer for part of speech tag tag tag list if sent buf length 0 tag get tag equals tag get tag equals tag get tag equals tag get tag equals sent buf append sent buf append tag get word return sent buf to string
rebuild a sentence from a tag list
private date parse relative string text parse position pos string new text text to upper case date parse date null for relative type ref relative type values string tmp pattern pattern replace all r ref to string simple apply pattern tmp pattern date tmp date simple parse new text pos if tmp date null parse date tmp date rel type ref return parse date
parse the relative reference interpreting relative terms such as next
public part of speech get part of speech return pos
get the part of speech for the word
public int get sense return sense
get the sense for the word
public void set sense int sense id sense sense id
set the sense for the word
public void set reference date date reference date ref date reference date
set the date that this date format uses as a reference
public void clean file rep files repository list files for file file rep files string file name file get name if file name ends with tmp png file name ends with old png file delete
clean the repository
public string get term return word
get the term represented by this index entry
public void add jfree chart chart string title chart get title get text add title chart
adds the chart to this panel
public void add string tab name jfree chart chart if chart map get tab name null throw new illegal argument exception tab named tab name already in use chart map put tab name chart chart panel panel new chart panel chart for chart mouse listener listener listeners panel add chart mouse listener listener pane add tab name panel
adds the chart to this panel using the specified tab name
public void add chart mouse listener chart mouse listener listener if listeners add listener for int i 0 i pane get component count i chart panel panel chart panel pane get component i panel add chart mouse listener listener
adds a chart mouse listener
public jfree chart get chart string tab name return chart map get tab name
gets the chart for the given tab name