input
stringlengths 10
828
| output
stringlengths 5
107
|
|---|---|
public void dynamic display int col if grid tab null grid tab is open return selective if col 0 return boolean no data grid tab get row count 0 list weditor list renderer get editors for weditor comp list grid field m field comp get grid field if m field null get included tab id m field 0 if no data comp set read write false else comp dynamic display boolean rw m field is editable true r w check context comp set read write rw all components
|
validate display properties of fields of current row
|
public void dynamic display int col if grid tab is open return selective if col 0 return boolean no data grid tab get row count 0 list weditor list renderer get editors for weditor comp list grid field m field comp get grid field if m field null get included tab id m field 0 if no data comp set read write false else comp dynamic display boolean rw m field is editable true r w check context comp set read write rw all components
|
validate the display properties of fields of current row
|
public void dynamic display
|
allow subclass to perform dynamic loading of data
|
public void execute iserver push callback callback boolean in uithread executions get current null boolean desktop activated false try if in uithread 1 second timeout if executions activate desktop 1000 desktop activated true else return callback update ui catch exception e logger log level warning server push error e get localized message e finally if in uithread desktop activated executions deactivate desktop
|
execute callback in ui thread
|
public void save preference if m ad user id 0 query query new query x ad preference table name query add restriction ad user id and attribute and ad window id is null for int i 0 i properties length i string attribute properties i string value props get property attribute mpreference preference query set parameters new object m ad user id attribute first only if preference null preference new mpreference env web get ctx 0 null preference set ad user id m ad user id preference set attribute attribute preference set value value preference save
|
save user preference
|
public void load preference int ad user id if ad user id 0 m ad user id ad user id props new properties query query new query x ad preference table name query add restriction ad user id and attribute and ad window id is null for int i 0 i properties length i string attribute properties i string value values i mpreference preference query set parameters new object m ad user id attribute first only if preference null value preference get value props set property attribute value
|
load user preference
|
public ctx get context return context
|
get server context proxy
|
public void value change value change event evt object new value evt get new value if new value instanceof integer env web get ctx set context m window no account id integer new value int value
|
value change account changed
|
protected void info list model table model data table get model int rows model get row count int count 0 for int i 0 i rows i if boolean model get value at i 0 boolean value count set status line count null info
|
list number of rows selected
|
public void unlock ui generate shipments complete unlock ui
|
unlock user interface
|
private boolean is product category field int column id x ad column col new x ad column env web get ctx column id null if col get id 0 return false column not found return m product category id equals col get column name is product category field
|
checks the given column
|
protected void info list model table model data table get model int rows model get row count int count 0 for int i 0 i rows i if boolean model get value at i 0 boolean value count status bar set status line string value of count msg get msg env get ctx sum
|
we go here for every selection unselection of items
|
private void init components font font new font dialog font bold 16 report label new jlabel label1 new basic text label label1 set font font label2 new basic text label label2 set font font label3 new basic text label label3 set font font
|
creates and configures the components used by the animations
|
private jcomponent build panel init components form layout layout new form layout fill max 250dlu pref grow fill pref grow 6dlu f 40dlu 6dlu f 40dlu 6dlu f 40dlu 6dlu panel builder builder new panel builder layout builder get panel set background color white builder set default dialog border cell constraints cc new cell constraints builder add report label cc xy 1 1 builder add label1 cc xy 1 3 builder add label2 cc xy 1 5 builder add label3 cc xy 1 7 return builder get panel
|
builds and returns the frames content pane
|
private void init components setup a basic text label with blue bold tahoma 20 pt text label new basic text label text label set font new font tahoma font bold 20 text label set color javaone blue vertical bars panel new vertical bars panel text label vertical bars panel set background color white vertical bars panel set fraction 0 2 duration field basic component factory create integer field new property adapter this propertyname duration pause field basic component factory create integer field new property adapter this propertyname pause create an action to animate the bars animate action new animate action
|
creates the text label sliders and animation actions
|
private jcomponent build panel form layout layout new form layout fill pref grow fill pref grow p p panel builder builder new panel builder layout cell constraints cc new cell constraints builder add build preview panel cc xy 1 1 builder add separator cc xy 1 2 builder add build tools panel cc xy 1 3 return builder get panel
|
builds and returns a panel with the preview in the top
|
private void init components setup a basic text label with red bold tahoma 24 pt text label new basic text label text label set font new font tahoma font bold 24 text label set color javaone red horizontal bars panel new horizontal bars panel text label horizontal bars panel set background color white duration field basic component factory create integer field new property adapter this propertyname duration pause field basic component factory create integer field new property adapter this propertyname pause create an action to animate the bars animate action new animate action
|
creates the text label sliders and animation actions
|
private void init components font font new font tahoma font bold 18 label1 new basic text label label1 set font font label1 set bounds 0 0 350 100 label1 set opaque false label2 new basic text label label2 set font font label2 set bounds 0 0 350 100 label2 set opaque false animate action new animate action
|
creates and configures the ui components
|
public jpanel build preview panel form layout layout new form layout fill 200dlu grow fill 100dlu grow jpanel panel new jpanel layout cell constraints cc new cell constraints panel set background color white panel add label1 cc xy 1 1 panel add label2 cc xy 1 1 return panel
|
builds this intro panel with two overlayed labels in the center
|
public object convert from subject object subject value color color color subject value return new integer color get alpha
|
converts a color to the colors alpha value
|
public void set value object new value int alpha integer new value int value color old color color subject get value subject set value new color old color get red old color get green old color get blue alpha
|
converts an alpha value between 0 and 255 to a color with that
|
private jcomponent build panel form layout layout new form layout fill pref grow fill p grow p p panel builder builder new panel builder layout cell constraints cc new cell constraints builder add build preview panel cc xy 1 1 builder add separator cc xy 1 2 builder add build tools panel cc xy 1 3 return builder get panel
|
builds and returns a panel with the preview in the top
|
public void animate long time if time duration if active apply effect is freezed duration 1 0 fire animation stopped time active false return if active active true fire animation started time apply effect time
|
performs the animation at the given time applies the animation
|
public string to string return get class get name duration duration active active
|
returns a string representation for this animation
|
public object value at long time return color value at time
|
returns the interpolated color for a given time in the valid
|
public animation get source return source
|
returns the animation the has originated this event
|
private color color value at long time check time range time return new color int red function value at time int green function value at time int blue function value at time int alpha function value at time
|
returns the interpolated color for a given time in the valid
|
public string to string return type type time time source source
|
returns an appropriate string representation
|
public void set bounds int x int y int w int h super set bounds x y w h set center new point x w 2 y h 2
|
sets the bounds and center point
|
public void paint component graphics g graphics2 d g2 graphics2 d g int diameter radius 2 g2 set rendering hint rendering hints key antialiasing rendering hints value antialias on g set color color g2 set stroke new basic stroke 4 g2 draw oval center x radius center y radius diameter diameter
|
paints the circle with anti aliasing enabled
|
public boolean is animated return animated
|
answers whether the animation is currently enabled
|
public void set origin point2 d origin renderer set origin origin repaint
|
sets a new origin of the fan
|
public void set rotation double rotation renderer set rotation rotation repaint
|
sets a new rotation
|
public void paint component graphics g graphics2 d g2 graphics2 d g g2 set rendering hint rendering hints key antialiasing rendering hints value antialias on g2 set rendering hint rendering hints key rendering rendering hints value render quality insets insets get insets int x insets left int y insets top int w get width x insets right int h get height y insets bottom g2 translate x y renderer render g2 w h g2 translate x y
|
delegates painting to the fan renderer
|
public color get foreground return base color
|
returns the labels foreground base color
|
public void paint component graphics g graphics2 d g2 graphics2 d g g2 set rendering hint rendering hints key antialiasing rendering hints value antialias on g2 set rendering hint rendering hints key rendering rendering hints value render quality renderer set font get font renderer render g2 get width get height
|
paints the component
|
public void set animated boolean animated boolean old animated animated this animated animated fire property change propertyname animated old animated animated
|
enables or disables the blend over effect
|
public void set duration long new duration long old duration duration duration new duration animation null fire property change propertyname duration old duration new duration
|
sets the animations duration and invalidates the animation cache
|
public void set foreground color new foreground color old foreground get foreground base color new foreground fire property change propertyname foreground old foreground new foreground
|
sets a new foreground base color
|
public void set text immediately string new text string old text get text labels background set text new text foreground 1 foreground background 1 background set alpha 255 0 fire property change propertyname text old text new text
|
sets a new text without using the blend over animation
|
private animation animation if animation null animation new blend over animation duration animation add animation listener new animation adapter public void animation stopped animation event e set alpha 255 0 return animation
|
lazily creates and returns the blend over animation
|
private void init components int font extra size labels new jlabel 2 labels foreground create bold label font extra size get translucent color 255 labels background create bold label font extra size get translucent color 255
|
creates and configures the ui components
|
private jlabel create bold label int size increment color a foreground jlabel label new anti aliased label font bold size increment label set foreground a foreground return label
|
creates and returns an anti aliased label with a bold font for the
|
private color get translucent color int alpha return new color base color get red base color get green base color get blue alpha
|
creates and returns a translucent color with the labels base color
|
private void set alpha0 int foreground alpha int background alpha labels foreground set foreground get translucent color foreground alpha labels background set foreground get translucent color background alpha
|
sets the foreground and background colors using the given alpha values
|
public void set font font new font if new font null throw new null pointer exception the font must not be null if new font equals font return font new font invalidate cache
|
sets the renderers font
|
public void set text string new text if new text null throw new null pointer exception the text must not be null if new text equals text return text new text invalidate cache
|
sets the renderers text
|
protected float get adjusted ascent if height mode height mode capital ascent return capital mascent else if height mode height mode text ascent return cached text ascent else return cached text height
|
computes and answers the text ascent using the current height mode
|
protected float get adjusted descent if height mode height mode capital ascent return 0 else if height mode height mode text ascent return 0 else return cached text height cached text ascent
|
computes and answers the text descent using the current height mode
|
protected void apply effect long time int foreground alpha int 255 time duration int background alpha 255 foreground alpha set alpha foreground alpha background alpha
|
applies the effect sets the text and time
|
public void animation started animation event evt just a convenience implementation
|
invoked if the animation has been started
|
public void animation stopped animation event evt just a convenience implementation
|
invoked if the animation has been stopped
|
private void ensure capital mascent computed font render context frc if capital mascent 0 return glyph vector m glyph vector font create glyph vector frc m capital mascent float m glyph vector get visual bounds get y
|
ensures that the ascent of a capital m has been computed
|
public int frames per second return frames per second
|
returns the desired frame rate
|
protected void invalidate cache set cache valid false cached glyph vector null cached glyph shapes null
|
invalidates the cache
|
public long elapsed time if timer is running return elapsed time long now system current time millis if start time 1 start time now return now start time elapsed time
|
returns the elapsed time since animation start
|
public void start if timer is running register stop listener start time 1 timer start
|
starts the animator and in turn the animation
|
protected void check time range long time if time 0 time duration throw new illegal argument exception the time must be larger than 0 and smaller than duration
|
checks whether the given time is in the valid time range that is
|
public void stop if timer is running elapsed time elapsed time timer stop
|
stops the animator
|
public void action performed action event e system out println t elapsed time animation animate elapsed time
|
implements the action listener interface used by the timer
|
public string to string return elapsed time elapsed time fps frames per second
|
returns a string representation for the animator
|
private timer create timer int fps int delay 1000 fps timer a timer new timer delay this a timer set initial delay 0 a timer set coalesce true return a timer
|
creates and configures a code timer code object
|
private void register stop listener animation add animation listener new animation adapter public void animation stopped animation event e system out println all animations stopped stop animation animate animation duration
|
registers a listener that stops the animator if the animation stopped
|
protected void apply effect long time fan set rotation rotation function value at time
|
applies the effect sets the time based rotation
|
public void update ui super update ui font font get font if 0 font extra size if font get style font style set font new font uiresource font derive font font style else set font new font uiresource new font font get name font style font get size font extra size
|
restores the font after the ui has changed
|
public void animate long time if effect applied return fire animation started time apply effect time fire animation stopped time effect applied true
|
applies the effect to the animation target
|
protected void apply effect long time label set text time 0 text if time duration label set time time
|
applies the effect sets the text and time
|
protected void apply effect long time label set text time 0 text label set color color color function value at time label set scale x scale xfunction value at time label set scale y scale yfunction value at time label set space space function value at time if is offset enabled label set offset x offset function value at time label set offset y offset function value at time
|
applies the effect sets color spacing scaling and offset
|
public boolean is offset enabled return offset enabled
|
answers whether the random position offset is enabled
|
public void set offset enabled boolean b offset enabled b
|
enables or disables the random position offset
|
private void add internal int origin depth string uri find the link via the hashcode link depth l to visit uris find get uri the depth of the uri int depth origin depth 1 is the link new if l null l create link null uri depth to visit uris find put uri l to visit uris add l else check if depth is to change if depth l get depth to visit uris remove l l set depth depth to visit uris add l
|
adds a new uri to the to be visted list
|
public void add parser listener iparser event listener l listener list add iparser event listener class l
|
adds a parser listener to listen to parsing events
|
public void remove parser listener iparser event listener l listener list remove iparser event listener class l
|
removes the parser listener from listening to events
|
public void stop total system current time millis start
|
stops the stop watch
|
public void reset total 0
|
resets the stop watch to 0
|
static public string byte to hex byte b returns hex string representation of byte b char hex digit 0 1 2 3 4 5 6 7 8 9 a b c d e f char array hex digit b 4 0x0f hex digit b 0x0f return new string array
|
converts a byte to hex
|
public icrawler get crawler return crawler
|
retrieves the crawler origin of this event if one was specified
|
public boolean accept string origin string link int depth return link null link starts with server
|
filters links which was specified in the constructor only these would be filtered
|
public boolean accept string origin string link int depth matcher m pattern matcher link return m matches
|
filters links which matches the pattern
|
private void initialize j label1 new jlabel j label1 set text 0 this set layout new box layout this box layout x axis this set size 300 23 this set font new font times new roman font plain 12 this add get jtext field null this add j label1 null this add get jbutton null j button add action listener this j text field add action listener this
|
this method initializes this
|
private jbutton get jbutton if j button null j button new jbutton j button set text draw j button set font new font times new roman font bold 12 return j button
|
this method initializes j button
|
private jtext field get jtext field if j text field null j text field new jtext field j text field set columns 15 return j text field
|
this method initializes j text field
|
private void check dec input string s throws wrong input exception if s length 0 throw new wrong input exception bitte f llen sie alle felder aus if s char at 0 45 throw new wrong input exception sie haben eine negative zahl eingegeben n der algorithmus geht nur mit positiven zahlen
|
dezimalzahl auf negative zahl pr fen
|
private void check bin input string s throws wrong input exception for int i 0 i s length i if s char at i 48 throw new wrong input exception bitte geben sie eine bin rzahl ein 0 1 else if s char at i 49 throw new wrong input exception bitte geben sie eine bin rzahl ein 0 1
|
bin reingabe wird gepr ft
|
private jtext area get text area ergebnisse if text area results null text area results new jtext area return text area results
|
this method initializes text area ergebnisse
|
private jscroll pane get scroll pane ergebnisse if scroll pane results null scroll pane results new jscroll pane get text area ergebnisse scroll pane results set bounds new rectangle 14 58 677 228 return scroll pane results
|
this method initializes text area ergebnisse
|
private jscroll pane get scroll pane ergebnisse if prognose scroll pane null prognose scroll pane new jscroll pane get text area ergebnisse prognose scroll pane set bounds new rectangle 14 58 677 228 return prognose scroll pane
|
this method initializes text area ergebnisse
|
private object load object string filename throws class not found exception ioexception object input stream objstream new object input stream new file input stream filename object object objstream read object objstream close return object
|
loads an object
|
ajoute un point a la fin du circuit public void add point point2 d double a if sommets is empty sommets add a else if sommets size 1 sommets get 0 equals a sommets add a else cout cout distance point2 d double sommets get sommets size 1 a sommets add a
|
add a point to the end of the circuit
|
public void add point point2 d a ajoute un point a la fin du circuit if sommets is empty sommets add a else if sommets size 1 sommets get 0 equals a sommets add a else cout cout arete distance point2 d sommets get sommets size 1 a sommets add a
|
add a point to the end of the circuit
|
public circuit copy circuit circuit copy new circuit for int i 0 i get size i copy sommets add get point i copy cout this cout return copy
|
copy the circuit in a new circuit
|
public void remove point point2 d p retire une arete du circuit sauf le premier et le dernier int ind sommets index of p cout arete distance point2 d sommets get ind 1 p cout arete distance p point2 d sommets get ind 1 cout arete distance point2 d sommets get ind 1 point2 d sommets get ind 1 sommets remove ind
|
removes a segment from the circuit
|
public void set arete arete a deb set location a deb fin set location a fin dist point2 d distance deb get x deb get y fin get x fin get y
|
change the segment
|
public void set arete point2 d a point2 d b deb a fin b dist point2 d distance a get x a get y b get x b get y
|
change the segment
|
public boolean contains point2 d p teste si le point p est dans l arete if deb equals p fin equals p return true return false todo on ne teste que s il est une borne et s il est dessus
|
test if the point is on the segment
|
public graphe get graph return graph
|
return the viewed graph
|
public double try cout int a int b double dist double tmp dist dist arete distance get point a get point a 1 arete distance get point b get point b 1 tmp dist arete distance get point a get point b arete distance get point a 1 get point b 1 return tmp dist dist
|
simulates the weight of a new graphe if the swap done
|
protected void show g new graph integer parse int string value of nb sommets g set nb pts integer parse int string value of nb sommets g set nb pts snm get number int value panel graph repaint
|
to repaint show the window
|
protected file chooz file jfile chooser file chooz new jfile chooser file chooz set accept all file filter used false file chooz set multi selection enabled false par defaut int return val file chooz show open dialog null if return val jfile chooser approve option dir file chooz get selected file system out println t as voulu ouvrir dir get absolute path return dir
|
open a window to choose a file to open a file
|
public void set arete arete a deb set location a deb fin set location a fin dist point2 d double distance deb get x deb get y fin get x fin get y
|
change the segment
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.