public class MTComponent
extends javax.swing.JComponent
Modifier and Type | Field and Description |
---|---|
Point2 |
initA |
Point2 |
initB |
OBB |
initOBB |
java.util.ArrayList<Point2> |
traceDoigt |
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
MTComponent() |
MTComponent(OBB obb) |
Modifier and Type | Method and Description |
---|---|
void |
click()
Moves component at the end of the list to display it front
|
void |
draw(java.awt.Graphics2D g) |
double |
getAngle()
Returns angle in radian
|
double |
getH()
Gets component height in pixels
|
OBB |
getOBB() |
Point2 |
getOrigin() |
double |
getScale() |
double |
getW()
Gets component width in pixels
|
boolean |
isInside(Point2 p)
Tells if point p is inside the rectangle defined by the component
|
void |
registerContainer(MTContainer container)
Registers container so the component knows his parent
|
void |
setAngle(double angle)
Sets angle in radian
|
void |
setAngleinDegrees(double angle)
Sets angle in degrees
|
void |
setOBB(OBB obb) |
void |
setOrigin(int x,
int y) |
void |
setPosition(Point2 origin,
double angle,
double width,
double height)
Sets current OBB with parameters
|
void |
setScale(double scale) |
void |
setTraceDoigt(java.util.ArrayList<Point2> traceDoigt) |
void |
setWH(int width,
int height) |
void |
updatePosition(Vector2 t,
double angle,
double k)
adds translation, angle (in radian) and scale to current ones
|
void |
updatePositionFromInit(Vector2 t,
double angle,
double k)
Adds translation t to current translation, same for angle and scale k
|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, 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, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, 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, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
add, add, add, add, add, addContainerListener, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, 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, getPeer, 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, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public java.util.ArrayList<Point2> traceDoigt
public Point2 initA
public Point2 initB
public OBB initOBB
public MTComponent()
public MTComponent(OBB obb)
public void draw(java.awt.Graphics2D g)
public void setOBB(OBB obb)
public void setTraceDoigt(java.util.ArrayList<Point2> traceDoigt)
public void setPosition(Point2 origin, double angle, double width, double height)
origin
- angle
- width
- height
- public OBB getOBB()
public void setAngleinDegrees(double angle)
angle
- public void setAngle(double angle)
angle
- public double getAngle()
public void updatePosition(Vector2 t, double angle, double k)
t
- angle
- k
- public void updatePositionFromInit(Vector2 t, double angle, double k)
t
- angle
- k
- public void setWH(int width, int height)
public void setOrigin(int x, int y)
public double getW()
public double getH()
public Point2 getOrigin()
public double getScale()
public void setScale(double scale)
public boolean isInside(Point2 p)
p
- public void registerContainer(MTContainer container)
container
- public void click()