public class DefaultGCanvas extends javax.swing.JPanel implements GCanvas
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_CURSOR |
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
DefaultGCanvas(java.awt.Color backgroundColor)
Contructor.Inicializa el objeto asignando color de fondo.
|
Modifier and Type | Method and Description |
---|---|
void |
addBorder(int x1,
int y1,
int x2,
int y2) |
void |
addDrawableElement(DrawableElement element)
Añade un elemento dibujable a la lista
|
void |
addValueChangedListener(IGCanvasListener listener)
Añadir un listener a la lista de eventos
|
void |
callDataChanged(java.lang.String key,
java.lang.Object value)
Invocar a los eventos asociados al componente
|
void |
callDataDragged(java.lang.String key,
java.lang.Object value)
Invocar a los eventos asociados al componente
|
DrawableElement |
createBorderLayerForGCanvas(java.awt.Color color)
Creates a border layer to the graphic canvas
|
DensitySlicingLine |
createDensitySliceForGCanvas(java.awt.Color color,
int levels)
Creates a density slice function for the graphic canvas
|
GraphicHistogram |
createHistogramForGCanvas(double[] data,
java.awt.Color color)
Creates a histogram for the graphic canvas
|
InfoLayer |
createInfoLayerForGCanvas(java.awt.Color colorLayer)
Creates a information layer for the graphic canvas
|
LogaritmicExponentialLine |
createLogaritmicExponentialLineForGCanvas(java.awt.Color color,
double point)
Creates a logaritmic or exponential function layer for the graphic canvas
|
MinMaxLines |
createMinMaxLinesForGCanvas(java.awt.Color color)
Creates a minmax layer for the graphic canvas
|
SquareRootPowLine |
createSquareRootPowLineForGCanvas(java.awt.Color color,
double point)
Creates a square root or pow line function for the graphic canvas
|
StraightLine |
createStraightLineForGCanvas(java.awt.Color color)
Creates a straight line layer for the graphic canvas
|
void |
execFirstDrawActions()
Ejecuta las acciones antes del primer dibujado de todos
los elementos dibujables
|
int |
getCanvasHeight()
Obtiene el alto del canvas sumando a partir de getCanvasY donde termina el área de dibujo
|
int |
getCanvasMaxX()
Obtiene la posición máxima en X del canvas donde terminar el dibujado
|
int |
getCanvasMaxY()
Obtiene la posición máxima en Y del canvas donde terminar el dibujado
|
int |
getCanvasMinX()
Obtiene la posición mínima en X del canvas donde comenzar a dibujar
|
int |
getCanvasMinY()
Obtiene la posición mínima en Y del canvas donde comenzar a dibujar
|
int |
getCanvasWidth()
Obtiene el ancho del canvas sumando a partir de getCanvasX donde termina el área de dibujo
|
java.util.List<DrawableElement> |
getDrawableElements(java.lang.Class<?> c1)
Obtiene todos los elementos dibujable que sean una instancia de c1
|
boolean |
isMouse()
Devuelve si en ese momento el raton esta sobre el canvas
|
void |
mouseClicked(java.awt.event.MouseEvent e) |
void |
mouseDragged(java.awt.event.MouseEvent e) |
void |
mouseEntered(java.awt.event.MouseEvent e) |
void |
mouseExited(java.awt.event.MouseEvent e) |
void |
mouseMoved(java.awt.event.MouseEvent e) |
void |
mousePressed(java.awt.event.MouseEvent e) |
void |
mouseReleased(java.awt.event.MouseEvent e) |
void |
paint(java.awt.Graphics g)
Inicializa el fondo y dibuja el gráfico sobre el canvas.
|
void |
removeDrawableElement(java.lang.Class<?> cl)
Elimina un elemento dibujable
|
void |
removeValueChangedListener(IGCanvasListener listener)
Borrar un listener de la lista de eventos
|
void |
replaceDrawableElement(DrawableElement element)
Reemplaza un elemento dibujable si encuentra uno de su mismo tipo
|
void |
replaceDrawableElement(DrawableElement element,
java.lang.Class<?> cl)
Reemplaza un elemento dibujable si encuentra uno del tipo especificado en el
parametro c1
|
void |
setDrawableElements(java.util.List<DrawableElement> list)
Asigna una lista de elementos dibujables
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
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, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, 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, setVisible, unregisterKeyboardAction, update
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, validateTree
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, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, 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 static final int DEFAULT_CURSOR
public DefaultGCanvas(java.awt.Color backgroundColor)
line
- Objeto líneabackgroundColor
- public void addBorder(int x1, int y1, int x2, int y2)
public void addValueChangedListener(IGCanvasListener listener)
addValueChangedListener
in interface GCanvas
listener
- public void removeValueChangedListener(IGCanvasListener listener)
removeValueChangedListener
in interface GCanvas
listener
- public void callDataChanged(java.lang.String key, java.lang.Object value)
callDataChanged
in interface GCanvas
public void callDataDragged(java.lang.String key, java.lang.Object value)
callDataDragged
in interface GCanvas
public void addDrawableElement(DrawableElement element)
addDrawableElement
in interface GCanvas
element
- public void replaceDrawableElement(DrawableElement element)
replaceDrawableElement
in interface GCanvas
element
- public void replaceDrawableElement(DrawableElement element, java.lang.Class<?> cl)
replaceDrawableElement
in interface GCanvas
element
- c1
- public java.util.List<DrawableElement> getDrawableElements(java.lang.Class<?> c1)
getDrawableElements
in interface GCanvas
c1
- public void removeDrawableElement(java.lang.Class<?> cl)
removeDrawableElement
in interface GCanvas
Class
- clase del elemento a eliminarpublic void setDrawableElements(java.util.List<DrawableElement> list)
setDrawableElements
in interface GCanvas
public void paint(java.awt.Graphics g)
public void execFirstDrawActions()
execFirstDrawActions
in interface GCanvas
public int getCanvasMinX()
getCanvasMinX
in interface GCanvas
public int getCanvasMinY()
getCanvasMinY
in interface GCanvas
public int getCanvasMaxX()
getCanvasMaxX
in interface GCanvas
public int getCanvasMaxY()
getCanvasMaxY
in interface GCanvas
public int getCanvasWidth()
getCanvasWidth
in interface GCanvas
public int getCanvasHeight()
getCanvasHeight
in interface GCanvas
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
public boolean isMouse()
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
public DrawableElement createBorderLayerForGCanvas(java.awt.Color color)
GCanvas
createBorderLayerForGCanvas
in interface GCanvas
public InfoLayer createInfoLayerForGCanvas(java.awt.Color colorLayer)
GCanvas
createInfoLayerForGCanvas
in interface GCanvas
public GraphicHistogram createHistogramForGCanvas(double[] data, java.awt.Color color)
GCanvas
createHistogramForGCanvas
in interface GCanvas
public MinMaxLines createMinMaxLinesForGCanvas(java.awt.Color color)
GCanvas
createMinMaxLinesForGCanvas
in interface GCanvas
public StraightLine createStraightLineForGCanvas(java.awt.Color color)
GCanvas
createStraightLineForGCanvas
in interface GCanvas
public LogaritmicExponentialLine createLogaritmicExponentialLineForGCanvas(java.awt.Color color, double point)
GCanvas
createLogaritmicExponentialLineForGCanvas
in interface GCanvas
public SquareRootPowLine createSquareRootPowLineForGCanvas(java.awt.Color color, double point)
GCanvas
createSquareRootPowLineForGCanvas
in interface GCanvas
public DensitySlicingLine createDensitySliceForGCanvas(java.awt.Color color, int levels)
GCanvas
createDensitySliceForGCanvas
in interface GCanvas