input
stringlengths 10
828
| output
stringlengths 5
107
|
|---|---|
protected void set tab tool tip text string tab tool tip text this tab tool tip text tab tool tip text
|
sets the tab name tool tip text
|
public image get tab image return tab image
|
returns the tab name image
|
public string get tab tool tip text return tab tool tip text
|
returns the tab name tool tip text
|
public integer get tab layer position return tab layer position
|
returns the position of this tabs layer on the final image
|
public int compare to tab container other tab if this tab layer position other tab get tab layer position return 1 else if this tab layer position other tab get tab layer position return 1 else return 0
|
implements comparable so that tabs can be sorted by
|
public void dispose super dispose dispose data
|
abstract method to be implemented by every tab
|
private void draw lips image graphics2 d g2d save the current composite java awt composite default composite g2d get composite set lips image opacity g2d set composite current composite opacity draw the lips image g2d draw image lips image 0 0 null restore the g2d original composite g2d set composite default composite
|
draws the lips image using the given graphics context
|
public void push undo event e if push undo is enabled push undo notify listeners swt selection e
|
notifies the undo menu item with the given event
|
private void init xmlsupport todo this code here try parser xmlreader factory create xmlreader catch saxexception e1 todo auto generated catch block e1 print stack trace hair style handler new hair style xmlhandler
|
initialize the xml reader and xml handler used for parsing
|
public void push redo event e if push redo is enabled push redo notify listeners swt selection e
|
notifies the redo menu item with the given event
|
private void widget disposed dispose event e if is new color disposable new color dispose if is current color disposable current color dispose current awt color null
|
dispose the used resources on widget disposed event
|
public void set current color color current color if is current color disposable this current color dispose is current color disposable false this current color current color this current awt color new java awt color current color get red current color get green current color get blue redraw
|
change this widgets current color
|
public void redraw image area tab container caller tab only selected tab has access to call for a redrawing if caller tab equals currnet tab parent redraw image area
|
call for a complete redrawing of the projects drawing area
|
public void set new color color new color if is new color disposable this new color dispose is new color disposable false this new color new color redraw
|
change the widgets new color candidate
|
public color get new color return new color
|
returns the widgets new color candidate
|
public void redraw image area image area redraw drawing container
|
asks the image area to redraw its current content
|
public void create history step create a new history step taking a snapshot of the tab s current state and place it to undo stack int used tab index tabs list index of currnet tab history step to undo new history step new snapshot tabs list get used tab index undo stack push to undo adjust the undo and redo buttons and clear the redo stack parent set enabled undo true parent set enabled redo false redo stack clear
|
create a history step for the current active tab
|
public void push full screen event e push full screen notify listeners swt selection e
|
notifies the full screen menu item with the given event
|
public project window get parent project return parent
|
returns the tabs container associated project
|
public void push clear event e push clear notify listeners swt selection e
|
notifies the clear menu item with the given event
|
public buffered image get original image return original image get subimage 0 0 original image get width original image get height
|
returns a copy of the projects original image
|
public void set show hair enabled boolean enabled show hair menu set enabled enabled
|
enables the show hair menu item if the argument is code true code
|
public void set eyes tracer enabled boolean enabled push eyes tracer set enabled enabled
|
enables the eyes tracer menu item if the argument is code true code
|
public void set lips tracer enabled boolean enabled push lips tracer set enabled enabled
|
enables the lips tracer menu item if the argument is code true code
|
public void set lens tracer enabled boolean enabled push lens tracer set enabled enabled
|
enables the lens tracer menu item if the argument is code true code
|
public void change hair visibility boolean selection for int i 0 i tab folder get item count i if tab folder get item i get control instanceof hair tab hair tab hair tab hair tab tab folder get item i get control hair tab set hair is visible selection break hair tab may be in one of the layers so we need to re split them for changes to take effect on the original image resplit layers
|
hides or unhides the
|
public void set show hair selected boolean selected todo the event should be sent even if the menu is disabled event e new event e widget show hair menu show hair menu set selection selected show hair menu notify listeners swt selection e
|
sets the selection state of the show hair menu item
|
public void original image changed for int i 0 i tab folder get item count i tab container tab tab container tab folder get item i get control tab original image changed
|
notify all tabs that the project original image was changed
|
public void dispose super dispose for tab container t tabs list t dispose lower layers null original image null upper layers null
|
dispose all unused resources to reduce memory leaks
|
public void register mouse listener mouse listener mouse listener image area register mouse listener mouse listener
|
adds the specified mouse listener to receive mouse motion events
|
public void register mouse motion listener mouse motion listener mouse motion listener image area register mouse motion listener mouse motion listener
|
adds the specified mouse motion listener to receive mouse motion events
|
private void set bottom composite enabled boolean option label size scale set enabled option size scale set enabled option label hair color set enabled option hair color chooser button set enabled option label highlights color set enabled option highlights color chooser button set enabled option
|
enables the bottom composite controls if the argument is
|
private void change hair buttons composite composite hair buttons composite hide all hair buttons group composites for control hair buttons parent scrolled composite container get children hair buttons parent set visible false show only the desired group scrolled composite set min size 0 hair buttons composite compute size swt default swt default y hair buttons composite set visible true hair buttons composite pack scrolled composite get vertical bar set selection 0 scrolled composite set origin 0 0
|
this method changes the current visible hair buttons group
|
private void set hand cursor mouse event e if final image null e get component set cursor new java awt cursor java awt cursor hand cursor else e get component set cursor new java awt cursor java awt cursor default cursor
|
change the mouse cursor to hand cursor if there is a hair displayed
|
public void load text object textarea throws exception buffered reader reader new buffered reader new input stream reader get class get resource as stream demodialog xml string buffer text new string buffer for int c reader read c 1 c reader read if c 0x1f c 0x7f c 0x9f c 0xffff c n text append char c else if c t text append reader close set string textarea text text to string
|
called if the demo
|
public void change editable boolean editable object textarea set boolean textarea editable editable
|
updates textareas editable property depending on a checkbox state
|
public void change enabled boolean enabled object textarea set boolean textarea enabled enabled
|
updates textareas enabled property
|
public void show dialog throws exception if dialog null dialog parse demodialog xml add dialog
|
shows the modal find dialog creates only one dialog instance
|
public void close dialog remove dialog
|
closes the dialog
|
public void insert list object list object item create item set string item text new item set icon item icon get icon icon library gif add list item 0 system out println click system current time millis try thread sleep 5000 catch interrupted exception ie
|
insert a new item into the list
|
public void delete list object delete object list for int i get count list 1 i 0 i object item get item list i if get boolean item selected remove item set boolean delete enabled false
|
removes the selected items from the list
|
public void change selection object list object delete set boolean delete enabled get selected index list 1
|
delete buttons state depends on the list selection
|
public void set selection object list string selection object delete for int i get count list 1 i 0 i set boolean get item list i selected false set choice list selection selection set boolean delete enabled false
|
clears list selection and updates the selection model
|
public void set log area thinlet thinlet object logarea this thinlet thinlet this logarea logarea
|
cache thinlet and the log textarea
|
private void log string text string buffer update new string buffer thinlet get string logarea text if update length 0 update append n update append text thinlet set string logarea text update to string int length update length to scroll down thinlet set integer logarea start length thinlet set integer logarea end length
|
append the given text to the log textarea
|
public void run try class thinletclass class for name get parameter class try content thinlet thinletclass get constructor new class applet class new instance new object this catch no such method exception nsme content thinlet thinletclass new instance remove all add content border layout center catch throwable exc remove all add new label exc get class get name exc get message label center border layout center do layout repaint
|
create a new i thinlet i instance of the class given as
|
private boolean init config throws ioexception props new properties try final input stream is properties url open stream props load is is close catch final null pointer exception e return false return true
|
load and publish configuration
|
private void dump registry log info n loaded plugins for final plugin descriptor pd plugin manager get registry get plugin descriptors log info pd get id pd get version end for
|
dump plugin registry
|
private void boot core throws exception log info n booting core plugin core plugin try log info n booting log info plugin manager get plugin core plugin catch final illegal argument exception e log fatal core plugin not found aborting system exit 1
|
boot the core plugin
|
public void hide switch back to original mode if show fullscreen device set display mode original display mode window dispose
|
switch to original mode
|
public int get width return window get width
|
return the window width
|
public int get height return window get height
|
return the window height
|
public void toggle fullscreen todo implement
|
toggle fullscreen mode
|
private file get manifest file final file folder file result new file folder plugin xml if result is file return result result new file folder plugin fragment xml if result is file return result return null
|
look for the plugin manifest for a given folder
|
public void inc rows num rows if num columns 1 num columns 1
|
increment number of rows
|
public void invalidate final layout container c queue offer c
|
invalidate the layout container
|
public void dec rows num rows if num rows 1 num rows 1 if num columns 1 num columns 1
|
decrement number of rows
|
public void stop validator set running false
|
stop the validation manager
|
public void inc columns num columns if num rows 1 num rows 1
|
increment number of columns
|
public void dec columns num columns if num columns 1 num columns 1 if num rows 1 num rows 1
|
decrement number of columns
|
public void set auto calc grid this num rows 0 this num columns 0
|
switch to auto calculate the grid
|
private void validate final layout container c final layout layout c get layout if layout null final boolean success layout layout c if success return end if for int i 0 i c get child count i final layoutable child c get i if child instanceof layout container validate layout container child end for
|
validate the layout container and all its children
|
public void hide art set running false wait for thread to stop while art is stopped graphics util sleep 10 switch back to original mode if show fullscreen device set display mode original display mode window dispose
|
stop rendering thread and switch to original mode
|
protected void do stop throws exception log info delta desk delta gui validation manager get instance stop desktop shutdown window hide log info delta desk delta gui
|
switch back to the original display mode and exit
|
protected void add direct final control child widget super add child widget
|
add a child to the composite
|
public void add final control child control if child controls contains child control throw new illegal argument exception child is already part of this control child control set parent this child controls add child control check if we have the focus if abstract control focused control this set focus invalidate set unrendered
|
add a control as child to this composite
|
public void remove final int index final control child child controls remove index child set parent null if focused control had the focus reset focus if abstract control focused control child set focus invalidate set unrendered
|
remove a child control
|
protected void invalidate if parent null parent invalidate
|
invalidate the control
|
protected void render control final graphics2 d g2 sub classes override this to render the controls
|
render the control
|
public void set source final url source if source null source equals this source return this source source scaled image null error false set unrendered load image delayed executor execute new runnable public void run try image image io read source if image null set preferred size image get width image get height else error true set unrendered invalidate catch ioexception e error true
|
set the source of the image
|
public void set size final int width final int height this width width this height height this main composite set size width height
|
set the desktop size
|
public void shutdown main composite remove all executor services shutdown
|
remove all child controls from main composite and stop all threads
|
private void update if image null get width 0 get height 0 scaled image graphics util resize image get width get height false set unrendered
|
update the scaled image
|
public void render final graphics2 d g2 main composite render g2
|
render the desktop
|
public void post key event final key event ke post event to parent composite of focused control so that the composite is able to handle focus traversal events abstract control focused control get parent post key event ke
|
post a key event
|
private void check location object component if mouseinside component parameter added by scolebourne find component content mousex mousey handle mouse event mousex mousex 1 false false false mouse event mouse entered mouseinside insidepart
|
check the previous mouse location again because of a possible layout change
|
public object parse input stream inputstream object handler throws ioexception return parse inputstream t handler
|
creates a component from the given stream and event handler
|
protected void parse xml input stream inputstream throws ioexception parse inputstream s null
|
you can use the internal xml parser as a simple sax like parser
|
protected object parse dom input stream inputstream throws ioexception return parse inputstream d null
|
you can use the internal xml parser as a simple dom like parser
|
public void set component object component string key component bean object definition get definition get class component key bean if set component definition 1 bean noticed by dawid weiss update component definition 2
|
set the awt component for the given currently i bean i widget
|
public person get arg0 return arg0
|
gets the value of the arg0 property
|
public void set arg0 person value this arg0 value
|
sets the value of the arg0 property
|
public get hello operation create get hello operation return new get hello operation
|
create an instance of
|
public update person create update person return new update person
|
create an instance of
|
public get hello operation response create get hello operation response return new get hello operation response
|
create an instance of
|
public get friends response create get friends response return new get friends response
|
create an instance of
|
public no return create no return return new no return
|
create an instance of
|
public get friends create get friends return new get friends
|
create an instance of
|
public update person response create update person response return new update person response
|
create an instance of
|
public boolean verify signature byte signature byte data try initialize keys sign init verify public key sign update data return sign verify signature catch signature exception e e print stack trace catch invalid key exception e return false
|
verifies the signature for the given bytes using the public key
|
public assertion comparison failure string message string expected string actual super message f expected expected f actual actual
|
constructs a comparison failure
|
static public void fail string message throw new assertion failure message
|
fails a test with the given message
|
static public void assert equals string message string expected string actual if expected null actual null return if expected null expected equals actual return throw new assertion comparison failure message expected actual
|
asserts that two strings are equal
|
public object get value if choices null return value else return selection index
|
returns the value
|
public void set value object value if choices null this value string value else selection index integer value
|
sets the value
|
public void add connection driver property p connection property cp new connection property p cp add property change listener this update listeners
|
method add connection
|
public driver property get driver return driver
|
returns the driver
|
public void set driver driver property driver this driver driver
|
sets the driver
|
public void add driver property info my driver property info info values put info name info
|
method add driver property info
|
public string get url return my driver property info values get url value
|
method get url
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.