Package org.sikuli.guide
Class Visual
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
org.sikuli.guide.Visual
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable,Cloneable
- Direct Known Subclasses:
SxAnchor,SxArea,SxArrow,SxBracket,SxCallout,SxCircle,SxClickable,SxFlag,SxImage,SxRectangle,SxSpotlight,SxText
public class Visual extends JComponent implements Cloneable
- See Also:
- Serialized Form
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classVisual.LayoutNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
Fields Modifier and Type Field Description Visual.LayoutcurrentLayoutstatic ColordefColorstatic ColordefColorBackstatic ColordefColorFramestatic ColordefColorFrontstatic ColordefColorTextstatic StringdefFontstatic intdefFontSizestatic intdefStrokebooleanhasChangedVisual.LayoutlayoutintPADDING_XintPADDING_YFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors Constructor Description Visual() -
Method Summary
Modifier and Type Method Description Visualabove()Visualabove(int y)voidaddAnimation(org.sikuli.guide.NewAnimator anim)voidaddAnimationListener(org.sikuli.guide.AnimationListener listener)voidaddCircleAnimation(Point origin, float radius)voidaddFadeinAnimation()voidaddFadeoutAnimation()voidaddFollower(Visual sklComp)voidaddMoveAnimation(Point source, Point destination)voidaddResizeAnimation(Dimension currentSize, Dimension targetSize)voidaddSlideAnimation(Point destination, Visual.Layout side)voidanimationCompleted()Visualbelow()Visualbelow(int y)Objectclone()AnimatorcreateMoveAnimator(int dest_x, int dest_y)AnimatorcreateSlidingAnimator(int offset_x, int offset_y)RectanglegetActualBounds()intgetActualHeight()PointgetActualLocation()DimensiongetActualSize()intgetActualWidth()PointgetCenter()static StringgetColorHex(Color col)RectanglegetFollowerBounds()ArrayList<Visual>getFollowers()VisualgetLeader()RegiongetRegion()RegiongetTarget()StringgetText()booleanisAutoLayoutEnabled()booleanisAutoMoveEnabled()booleanisAutoResizeEnabled()booleanisAutoVisibilityEnabled()Visualleft()Visualleft(int x)voidmoveTo(Point targetLocation)voidmoveTo(Point targetLocation, org.sikuli.guide.AnimationListener listener)voidoffsetLocation(int x, int y)voidpaint(Graphics g)voidpaintPlain(Graphics g)voidpopin()voidpopout()voidremoveFollower(Visual comp)voidremoveFrom(Container container)voidremoveFromLeader()voidresizeTo(Dimension targetSize)Visualright()Visualright(int x)voidsetActualBounds(Rectangle actualBounds)voidsetActualLocation(int x, int y)voidsetActualLocation(Point location)voidsetActualSize(int width, int height)voidsetActualSize(Dimension actualSize)voidsetAutoLayoutEnabled(boolean autoLayoutEnabled)voidsetAutoMoveEnabled(boolean autoMoveEnabled)voidsetAutoResizeEnabled(boolean autoResizeEnabled)voidsetAutoVisibilityEnabled(boolean autoVisibilityEnabled)VisualsetColor(int r, int g, int b)set the front and back color as (r, g, b) integer arrayVisualsetColor(Color color)set the front and back colorVisualsetColors(int[] front, int[] back, int[] frame, int[] text)mainly for Jython layer: colors given as (r, g, b) integer arrayVisualsetColors(Color all, Color front, Color back, Color frame, Color text)set a Java Color for the component
not all components have all color optionsvoidsetEmphasisAnimation(Animator anim)voidsetEntranceAnimation(Animator anim)VisualsetFont(String font, int fontSize)VisualsetFontSize(int i)voidsetGuide(Guide g)voidsetHorizontalAlignmentWithRegion(Region region, float f)VisualsetLayout(Visual.Layout lo)VisualsetLocationRelative(Visual.Layout side)voidsetLocationRelativeToComponent(Visual leader)voidsetLocationRelativeToComponent(Visual comp, float relativeX, float relativeY)voidsetLocationRelativeToComponent(Visual comp, int offsetx, int offsety)voidsetLocationRelativeToComponent(Visual comp, Visual.Layout side)voidsetLocationRelativeToPoint(Point point, Visual.Layout side)VisualsetLocationRelativeToRegion(Region region, Visual.Layout side)voidsetMargin(int top, int left, int bottom, int right)VisualsetMaxWidth(int w)voidsetMovable(boolean movable)voidsetOffset(int offsetx, int offsety)voidsetOpacity(float opacity)VisualsetScale(float scale)voidsetShadow(int shadowSize, int shadowOffset)voidsetShadowDefault()VisualsetStroke(int stk)<RCPS> VisualsetTarget(RCPS target)VisualsetText(String text)VisualsetTextColor(int r, int g, int b)set text color as (r, g, b) integer arrayVisualsetTextColor(Color color)set the text colorvoidsetVerticalAlignmentWithRegion(Region region, float f)voidsetVisible(boolean visible)voidsetZoomLevel(float zoomLevel)voidstartAnimation()voidstopAnimation()StringtoString()voidupdateComponent()Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUI, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update, updateUIMethods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeMethods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
hasChanged
public boolean hasChanged -
PADDING_X
public int PADDING_X -
PADDING_Y
public int PADDING_Y -
layout
-
currentLayout
-
defColor
-
defColorFront
-
defColorBack
-
defColorFrame
-
defColorText
-
defStroke
public static int defStroke -
defFont
-
defFontSize
public static int defFontSize
-
-
Constructor Details
-
Visual
public Visual()
-
-
Method Details
-
setGuide
-
getTarget
-
setScale
-
setLayout
-
setColors
set a Java Color for the component
not all components have all color options- Parameters:
all- sets the color for all options (which have to be null in this case)front- sets the foreground colorback- sets the background colorframe- sets the color of the frametext- sets the color of the text- Returns:
- the component itself for dot-chaining
-
setColors
mainly for Jython layer: colors given as (r, g, b) integer array- Parameters:
front- sets the foreground colorback- sets the background colorframe- sets the color of the frametext- sets the color of the text- Returns:
- the component itself for dot-chaining
-
setColor
set the front and back color- Parameters:
color-- Returns:
- the component itself
-
setColor
set the front and back color as (r, g, b) integer array- Returns:
- the component itself
-
setTextColor
set the text color- Parameters:
color-- Returns:
- the component itself
-
setTextColor
set text color as (r, g, b) integer array- Returns:
- the component itself
-
getColorHex
-
setStroke
-
setFont
-
setFontSize
-
setMaxWidth
-
getText
-
setText
-
setAutoLayoutEnabled
public void setAutoLayoutEnabled(boolean autoLayoutEnabled) -
isAutoLayoutEnabled
public boolean isAutoLayoutEnabled() -
setAutoResizeEnabled
public void setAutoResizeEnabled(boolean autoResizeEnabled) -
isAutoResizeEnabled
public boolean isAutoResizeEnabled() -
setAutoMoveEnabled
public void setAutoMoveEnabled(boolean autoMoveEnabled) -
isAutoMoveEnabled
public boolean isAutoMoveEnabled() -
setAutoVisibilityEnabled
public void setAutoVisibilityEnabled(boolean autoVisibilityEnabled) -
isAutoVisibilityEnabled
public boolean isAutoVisibilityEnabled() -
getActualBounds
-
getRegion
-
setActualBounds
-
getCenter
-
getActualSize
-
setActualSize
public void setActualSize(int width, int height) -
setActualSize
-
getActualWidth
public int getActualWidth() -
getActualHeight
public int getActualHeight() -
getActualLocation
-
offsetLocation
public void offsetLocation(int x, int y) -
setActualLocation
-
setActualLocation
public void setActualLocation(int x, int y) -
setMargin
public void setMargin(int top, int left, int bottom, int right) -
setOffset
public void setOffset(int offsetx, int offsety) -
setZoomLevel
public void setZoomLevel(float zoomLevel) -
setMovable
public void setMovable(boolean movable) -
setOpacity
public void setOpacity(float opacity) -
updateComponent
public void updateComponent() -
paintPlain
-
paint
- Overrides:
paintin classJComponent
-
setShadowDefault
public void setShadowDefault() -
setShadow
public void setShadow(int shadowSize, int shadowOffset) -
addAnimation
public void addAnimation(org.sikuli.guide.NewAnimator anim) -
addMoveAnimation
-
addResizeAnimation
-
addCircleAnimation
-
addFadeinAnimation
public void addFadeinAnimation() -
addFadeoutAnimation
public void addFadeoutAnimation() -
addSlideAnimation
-
startAnimation
public void startAnimation() -
stopAnimation
public void stopAnimation() -
createSlidingAnimator
-
createMoveAnimator
-
resizeTo
-
moveTo
-
moveTo
-
popin
public void popin() -
popout
public void popout() -
setEntranceAnimation
-
setEmphasisAnimation
-
addAnimationListener
public void addAnimationListener(org.sikuli.guide.AnimationListener listener) -
animationCompleted
public void animationCompleted() -
left
-
left
-
right
-
right
-
above
-
above
-
below
-
below
-
setTarget
-
setLocationRelative
-
setLocationRelativeToComponent
-
setLocationRelativeToComponent
-
setLocationRelativeToComponent
-
setLocationRelativeToComponent
-
setLocationRelativeToPoint
-
setLocationRelativeToRegion
-
setHorizontalAlignmentWithRegion
-
setVerticalAlignmentWithRegion
-
removeFromLeader
public void removeFromLeader() -
addFollower
-
setVisible
public void setVisible(boolean visible)- Overrides:
setVisiblein classJComponent
-
getFollowers
-
getLeader
-
removeFollower
-
getFollowerBounds
-
removeFrom
-
toString
-
clone
-