grafica
Class GPlot

java.lang.Object
  extended by grafica.GPlot
All Implemented Interfaces:
PConstants

public class GPlot
extends Object
implements PConstants

Plot class. It controls the rest of the graphical elements (layers, axes, title, limits).

Author:
Javier Gracia Carpio http://www.openprocessing.org/user/16300

Field Summary
static int ALTMOD
           
static int BOTH
           
static int CTRLMOD
           
static int HORIZONTAL
           
static float LOG10
           
static String MAINLAYERID
           
static int METAMOD
           
static int NONE
           
static int SHIFTMOD
           
static int VERTICAL
           
 
Fields inherited from interface processing.core.PConstants
ADD, ALPHA, ALT, AMBIENT, ARC, ARGB, ARROW, BACKSPACE, BASELINE, BEVEL, BEZIER_VERTEX, BLEND, BLUR, BOTTOM, BOX, BREAK, BURN, CENTER, CHATTER, CHORD, CLAMP, CLOSE, CODED, COMPLAINT, CONTROL, CORNER, CORNERS, CROSS, CURVE_VERTEX, CUSTOM, DARKEST, DEG_TO_RAD, DELETE, DIAMETER, DIFFERENCE, DILATE, DIRECTIONAL, DISABLE_DEPTH_MASK, DISABLE_DEPTH_SORT, DISABLE_DEPTH_TEST, DISABLE_NATIVE_FONTS, DISABLE_OPENGL_ERRORS, DISABLE_OPTIMIZED_STROKE, DISABLE_RETINA_PIXELS, DISABLE_STROKE_PERSPECTIVE, DISABLE_STROKE_PURE, DISABLE_TEXTURE_MIPMAPS, DODGE, DOWN, DXF, ELLIPSE, ENABLE_DEPTH_MASK, ENABLE_DEPTH_SORT, ENABLE_DEPTH_TEST, ENABLE_NATIVE_FONTS, ENABLE_OPENGL_ERRORS, ENABLE_OPTIMIZED_STROKE, ENABLE_RETINA_PIXELS, ENABLE_STROKE_PERSPECTIVE, ENABLE_STROKE_PURE, ENABLE_TEXTURE_MIPMAPS, ENTER, EPSILON, ERODE, ERROR_BACKGROUND_IMAGE_FORMAT, ERROR_BACKGROUND_IMAGE_SIZE, ERROR_PUSHMATRIX_OVERFLOW, ERROR_PUSHMATRIX_UNDERFLOW, ERROR_TEXTFONT_NULL_PFONT, ESC, EXCLUSION, GIF, GRAY, GROUP, HALF_PI, HAND, HARD_LIGHT, HINT_COUNT, HSB, IMAGE, INVERT, JAVA2D, JPEG, LANDSCAPE, LEFT, LIGHTEST, LINE, LINE_LOOP, LINE_STRIP, LINES, LINUX, MACOSX, MAX_FLOAT, MAX_INT, MIN_FLOAT, MIN_INT, MITER, MODEL, MODELVIEW, MOVE, MULTIPLY, NORMAL, OPAQUE, OPEN, OPENGL, ORTHOGRAPHIC, OTHER, OVERLAY, P2D, P3D, PATH, PDF, PERSPECTIVE, PI, PIE, platformNames, POINT, POINTS, POLYGON, PORTRAIT, POSTERIZE, PROBLEM, PROJECT, PROJECTION, QUAD, QUAD_BEZIER_VERTEX, QUAD_STRIP, QUADRATIC_VERTEX, QUADS, QUARTER_PI, RAD_TO_DEG, RADIUS, RECT, REPEAT, REPLACE, RETURN, RGB, RIGHT, ROUND, SCREEN, SHAPE, SHIFT, SOFT_LIGHT, SPHERE, SPOT, SQUARE, SUBTRACT, TAB, TARGA, TAU, TEXT, THIRD_PI, THRESHOLD, TIFF, TOP, TRIANGLE, TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, UP, VERTEX, WAIT, WHITESPACE, WINDOWS, X, Y, Z
 
Constructor Summary
GPlot(PApplet parent)
          GPlot constructor
GPlot(PApplet parent, float xPos, float yPos)
          GPlot constructor
GPlot(PApplet parent, float xPos, float yPos, float plotWidth, float plotHeight)
          GPlot constructor
 
Method Summary
 void activateCentering()
          Activates the option to center the plot with the mouse using the LEFT button
 void activateCentering(int button)
          Activates the option to center the plot with the mouse using the specified button
 void activateCentering(int button, int keyModifier)
          Activates the option to center the plot with the mouse using the specified button and the specified key modifier
 void activatePanning()
          Activates the option to pan the plot with the mouse using the LEFT button
 void activatePanning(int button)
          Activates the option to pan the plot with the mouse using the specified button
 void activatePanning(int button, int keyModifier)
          Activates the option to pan the plot with the mouse using the specified button and the specified key modifier
 void activatePointLabels()
          Activates the option to draw the labels of the points with the mouse using the LEFT button
 void activatePointLabels(int button)
          Activates the option to draw the labels of the points with the mouse using the specified button
 void activatePointLabels(int button, int keyModifier)
          Activates the option to draw the labels of the points with the mouse using the specified button and the specified key modifier
 void activateReset()
          Activates the option to return to the value of the axes limits previous to any mouse interaction, using the RIGHT button
 void activateReset(int button)
          Activates the option to return to the value of the axes limits previous to any mouse interaction, using the specified button
 void activateReset(int button, int keyModifier)
          Activates the option to return to the value of the axes limits previous to any mouse interaction, using the specified button and the specified key modifier
 void activateZooming()
          Activates the option to zoom with the mouse using the LEFT and RIGHT buttons
 void activateZooming(float factor)
          Activates the option to zoom with the mouse using the LEFT and RIGHT buttons
 void activateZooming(float factor, int increaseButton, int decreaseButton)
          Activates the option to zoom with the mouse using the specified buttons
 void activateZooming(float factor, int increaseButton, int decreaseButton, int increaseKeyModifier, int decreaseKeyModifier)
          Activates the option to zoom with the mouse using the specified buttons and the specified key modifiers
 void addLayer(GLayer newLayer)
          Adds a layer to the plot
 void addLayer(String id, GPointsArray points)
          Adds a new layer to the plot
 void addPoint(float x, float y)
          Adds a new point to the main layer points
 void addPoint(float x, float y, String label)
          Adds a new point to the main layer points
 void addPoint(float x, float y, String label, String layerId)
          Adds a new point to the specified layer points
 void addPoint(GPoint newPoint)
          Adds a new point to the main layer points
 void addPoint(GPoint newPoint, String layerId)
          Adds a new point to the specified layer points
 void addPoint(int index, float x, float y)
          Adds a new point to the main layer points
 void addPoint(int index, float x, float y, String label)
          Adds a new point to the main layer points
 void addPoint(int index, float x, float y, String label, String layerId)
          Adds a new point to the specified layer points
 void addPoint(int index, GPoint newPoint)
          Adds a new point to the main layer points
 void addPoint(int index, GPoint newPoint, String layerId)
          Adds a new point to the specified layer points
 void addPointAt(float xScreen, float yScreen)
          Adds a point to the main layer at a given screen position
 void addPointAt(float xScreen, float yScreen, String layerId)
          Adds a point to the specified layer at a given screen position
 void addPoints(GPointsArray newPoints)
          Adds new points to the main layer points
 void addPoints(GPointsArray newPoints, String layerId)
          Adds new points to the specified layer points
 void align(float[] value, float xScreen, float yScreen)
          Shifts the plot coordinates in a way that after that the given plot value will be at the specified screen position
 void align(float xValue, float yValue, float xScreen, float yScreen)
          Shifts the plot coordinates in a way that after that the given plot value will be at the specified screen position
 void beginDraw()
          Prepares the environment to start drawing the different plot components (points, axes, title, etc).
 float[] calculatePointsXLim(GPointsArray points)
          Calculates the x limits of a given set of points, considering the plot properties (axis log scale, if the other axis limits are fixed, etc)
 float[] calculatePointsYLim(GPointsArray points)
          Calculates the y limits of a given set of points, considering the plot properties (axis log scale, if the other axis limits are fixed, etc)
 void center(float xScreen, float yScreen)
          Centers the plot coordinates at the plot value that is at the specified screen position
 void centerAndZoom(float factor, float xValue, float yValue)
          Centers the plot coordinates on the specified (x, y) point and zooms the limits range by a given factor
 void deactivateCentering()
          Deactivates the option to center the plot with the mouse
 void deactivatePanning()
          Deactivates the option to pan the plot with the mouse
 void deactivatePointLabels()
          Deactivates the option to draw the labels of the points with the mouse
 void deactivateReset()
          Deactivates the option to return to the value of the axes limits previous to any mouse interaction using the mouse
 void deactivateZooming()
          Deactivates the option to zoom with the mouse
 void defaultDraw()
          Draws the plot on the screen with default parameters
 void drawAnnotation(String text, float x, float y, int horAlign, int verAlign)
          Draws an annotation at a given plot value
 void drawBackground()
          Draws the plot background.
 void drawBox()
          Draws the box area.
 void drawFilledContours(int contourType, float referenceValue)
          Draws filled contours connecting the points from all layers in the plot and a reference value
 void drawGridLines(int gridType)
          Draws lines connecting the horizontal and vertical axis ticks
 void drawHistograms()
          Draws the histograms of all layers
 void drawHorizontalLine(float value)
          Draws an horizontal line in the plot
 void drawHorizontalLine(float value, int lineColor, float lineWidth)
          Draws an horizontal line in the plot
 void drawLabel(GPoint point)
          Draws the label of a given point
 void drawLabels()
          Draws the labels of the points in the layers that are close to the mouse position.
 void drawLabelsAt(float xScreen, float yScreen)
          Draws the labels of the points in the layers that are close to a given screen position
 void drawLegend(String[] text, float[] xRelativePos, float[] yRelativePos)
          Draws a legend at the specified relative position
 void drawLine(float slope, float yCut)
          Draws a line in the plot, defined by the slope and the cut in the y axis
 void drawLine(float slope, float yCut, int lineColor, float lineWidth)
          Draws a line in the plot, defined by the slope and the cut in the y axis
 void drawLine(GPoint point1, GPoint point2)
          Draws a line in the plot, defined by two extreme points
 void drawLine(GPoint point1, GPoint point2, int lineColor, float lineWidth)
          Draws a line in the plot, defined by two extreme points
 void drawLines()
          Draws lines connecting the points from all layers in the plot
 void drawPoint(GPoint point)
          Draws a point in the plot
 void drawPoint(GPoint point, int pointColor, float pointSize)
          Draws a point in the plot
 void drawPoint(GPoint point, PImage pointImg)
          Draws a point in the plot
 void drawPoint(GPoint point, PShape pointShape)
          Draws a point in the plot
 void drawPoint(GPoint point, PShape pointShape, int pointColor)
          Draws a point in the plot
 void drawPoints()
          Draws the points from all layers in the plot
 void drawPoints(PImage pointImg)
          Draws the points from all layers in the plot
 void drawPoints(PShape pointShape)
          Draws the points from all layers in the plot
 void drawPolygon(GPointsArray polygonPoints, int polygonColor)
          Draws a polygon defined by a set of points
 void drawRightAxis()
          Draws the right axis
 void drawTitle()
          Draws the title
 void drawTopAxis()
          Draws the top axis
 void drawVerticalLine(float value)
          Draws a vertical line in the plot
 void drawVerticalLine(float value, int lineColor, float lineWidth)
          Draws a vertical line in the plot
 void drawXAxis()
          Draws the x axis
 void drawYAxis()
          Draws the y axis
 void endDraw()
          Returns the sketch to the state that it had before calling beginDraw()
 float[] getDim()
          Returns the box dimensions
 boolean getFixedXLim()
          Returns true if the horizontal axes limits are fixed
 boolean getFixedYLim()
          Returns true if the vertical axes limits are fixed
 GHistogram getHistogram()
          Returns the histogram of the main layer
 GHistogram getHistogram(String layerId)
          Returns the histogram of the specified layer
 boolean getInvertedXScale()
          Returns true if the horizontal axes limits are inverted
 boolean getInvertedYScale()
          Returns true if the vertical axes limits are inverted
 GLayer getLayer(String id)
          Returns a layer with an specific id
 GLayer getMainLayer()
          Returns the plot main layer
 float[] getMar()
          Returns the plot margins
 float[] getOuterDim()
          Returns the plot outer dimensions
 float[] getPlotPosAt(float xScreen, float yScreen)
          Calculates the position of a point in the screen, relative to the plot reference system
 GPoint getPointAt(float xScreen, float yScreen)
          Returns the closest point in the main layer to a given screen position
 GPoint getPointAt(float xScreen, float yScreen, String layerId)
          Returns the closest point in the specified layer to a given screen position
 GPointsArray getPoints()
          Returns a copy of the points of the main layer
 GPointsArray getPoints(String layerId)
          Returns a copy of the points of the specified layer
 GPointsArray getPointsRef()
          Returns the points of the main layer
 GPointsArray getPointsRef(String layerId)
          Returns the points of the specified layer
 float[] getPos()
          Returns the plot position
 float[] getRelativePlotPosAt(float xScreen, float yScreen)
          Returns the relative plot position of a given screen position
 GAxis getRightAxis()
          Returns the plot right axis
 float[] getScreenPosAtValue(float xValue, float yValue)
          Calculates the position of a given (x, y) point in the parent Processing applet screen
 GTitle getTitle()
          Returns the plot title
 GAxis getTopAxis()
          Returns the plot top axis
 float[] getValueAt(float xScreen, float yScreen)
          Returns the plot value at a given screen position
 GAxis getXAxis()
          Returns the plot x axis
 float[] getXLim()
          Returns the limits of the horizontal axes
 boolean getXLog()
          Returns true if the horizontal axes scale is logarithmic
 GAxis getYAxis()
          Returns the plot y axis
 float[] getYLim()
          Returns the limits of the vertical axes
 boolean getYLog()
          Returns true if the vertical axes scale is logarithmic
 void invertXScale()
          Inverts the horizontal axes scale
 void invertYScale()
          Inverts the vertical axes scale
 boolean isOverBox(float xScreen, float yScreen)
          Indicates if a given screen position is inside the plot box area
 boolean isOverPlot(float xScreen, float yScreen)
          Indicates if a given screen position is inside the main plot area
 void mouseEvent(MouseEvent event)
          Mouse events (zooming, centering, panning, labeling)
 void moveHorizontalAxesLim(float delta)
          Moves the horizontal axes limits by a given amount specified in pixel units
 void moveVerticalAxesLim(float delta)
          Moves the vertical axes limits by a given amount specified in pixel units
 void removeLayer(String id)
          Removes an exiting layer from the plot, provided it is not the plot main layer
 void removePoint(int index)
          Removes one of the main layer points
 void removePoint(int index, String layerId)
          Removes one of the specified layer points
 void removePointAt(float xScreen, float yScreen)
          Removes a point from the main layer at a given screen position
 void removePointAt(float xScreen, float yScreen, String layerId)
          Removes a point from the specified layer at a given screen position
 void setAllFontProperties(String fontName, int fontColor, int fontSize)
          Sets the properties of the font that will be used in all plot elements (layer, axes, title, histogram)
 void setAxesOffset(float offset)
          Sets the axis offset for all the axes in the plot
 void setBgColor(int newBgColor)
          Sets the plot background color
 void setBoxBgColor(int newBoxBgColor)
          Sets the box background color
 void setBoxLineColor(int newBoxLineColor)
          Sets the box line color
 void setBoxLineWidth(float newBoxLineWidth)
          Sets the box line width
 void setDim(float[] newDim)
          Sets the plot box dimensions
 void setDim(float xDim, float yDim)
          Sets the plot box dimensions
 void setDrawHistLabels(boolean drawHistLabels)
          Sets if the labels of the histogram in the main layer will be drawn or not
 void setExpandLimFactor(float expandFactor)
          Sets the factor that is used to expand the axes limits
 void setFixedXLim(boolean newFixedXLim)
          Sets if the horizontal axes limits are fixed or not
 void setFixedYLim(boolean newFixedYLim)
          Sets if the vertical axes limits are fixed or not
 void setFontColor(int fontColor)
          Sets the color of the font that is used in the main layer
 void setFontName(String fontName)
          Sets the name of the font that is used in the main layer
 void setFontProperties(String fontName, int fontColor, int fontSize)
          Sets the properties of the font that is used in the main layer
 void setFontSize(int fontSize)
          Sets the size of the font that is used in the main layer
 void setGridLineColor(int newGridLineColor)
          Sets the grid line color
 void setGridLineWidth(float newGridLineWidth)
          Sets the grid line width
 void setHistBasePoint(GPoint basePoint)
          Sets the base point for the histogram in the main layer
 void setHistType(int histType)
          Sets the histogram type for the histogram in the main layer
 void setHistVisible(boolean visible)
          Sets if the histogram in the main layer is visible or not
 void setHorizontalAxesNTicks(int nTicks)
          Sets the approximate number of ticks in the horizontal axes.
 void setHorizontalAxesTicks(float[] ticks)
          Sets the horizontal axes ticks
 void setHorizontalAxesTicksSeparation(float ticksSeparation)
          Sets the separation between the ticks in the horizontal axes
 void setIncludeAllLayersInLim(boolean includeAllLayers)
          Sets if all the plot layers should be considered in the axes limits calculation
 void setInvertedXScale(boolean newInvertedXScale)
          Sets if the scale of the horizontal axes should be inverted or not
 void setInvertedYScale(boolean newInvertedYScale)
          Sets if the scale of the vertical axes should be inverted or not
 void setLabelBgColor(int labelBgColor)
          Sets the label background color of the points in the main layer
 void setLabelSeparation(float[] labelSeparation)
          Sets the label separation of the points in the main layer
 void setLineColor(int lineColor)
          Sets the line color for the main layer
 void setLineWidth(float lineWidth)
          Sets the line width for the main layer
 void setLogScale(String logType)
          Sets if the scale for the horizontal and vertical axes is logarithmic or not
 void setMar(float[] newMar)
          Sets the plot margins
 void setMar(float bottomMargin, float leftMargin, float topMargin, float rightMargin)
          Sets the plot margins
 void setOuterDim(float[] newOuterDim)
          Sets the plot outer dimensions
 void setOuterDim(float xOuterDim, float yOuterDim)
          Sets the plot outer dimensions
 void setPoint(int index, float x, float y)
          Sets one of the main layer points
 void setPoint(int index, float x, float y, String label)
          Sets one of the main layer points
 void setPoint(int index, float x, float y, String label, String layerId)
          Sets one of the specified layer points
 void setPoint(int index, GPoint newPoint)
          Sets one of the main layer points
 void setPoint(int index, GPoint newPoint, String layerId)
          Sets one of the specified layer points
 void setPointColor(int pointColor)
          Sets the point color for the main layer
 void setPointColors(int[] pointColors)
          Sets the point colors for the main layer
 void setPoints(GPointsArray points)
          Sets the points for the main layer
 void setPoints(GPointsArray points, String layerId)
          Sets the points for the specified layer
 void setPointSize(float pointSize)
          Sets the point size for the main layer
 void setPointSizes(float[] pointSizes)
          Sets the point sizes for the main layer
 void setPos(float[] newPos)
          Sets the plot position
 void setPos(float x, float y)
          Sets the plot position
 void setTicksLength(float tickLength)
          Sets the tick length for all the axes in the plot
 void setTitleText(String text)
          Set the plot title text
 void setVerticalAxesNTicks(int nTicks)
          Sets the approximate number of ticks in the vertical axes.
 void setVerticalAxesTicks(float[] ticks)
          Sets the vertical axes ticks
 void setVerticalAxesTicksSeparation(float ticksSeparation)
          Sets the separation between the ticks in the vertical axes
 void setXLim(float[] newXLim)
          Sets the horizontal axes limits
 void setXLim(float lowerLim, float upperLim)
          Sets the horizontal axes limits
 void setYLim(float[] newYLim)
          Sets the vertical axes limits
 void setYLim(float lowerLim, float upperLim)
          Sets the vertical axes limits
 void startHistograms(int histType)
          Initializes the histograms in all the plot layers
 void updateLimits()
          Calculates and updates the plot x and y limits
 void zoom(float factor)
          Zooms the limits range by a given factor
 void zoom(float factor, float xScreen, float yScreen)
          Zooms the limits range by a given factor keeping the same plot value at the specified screen position
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAINLAYERID

public static final String MAINLAYERID
See Also:
Constant Field Values

VERTICAL

public static final int VERTICAL
See Also:
Constant Field Values

HORIZONTAL

public static final int HORIZONTAL
See Also:
Constant Field Values

BOTH

public static final int BOTH
See Also:
Constant Field Values

NONE

public static final int NONE
See Also:
Constant Field Values

ALTMOD

public static final int ALTMOD
See Also:
Constant Field Values

CTRLMOD

public static final int CTRLMOD
See Also:
Constant Field Values

METAMOD

public static final int METAMOD
See Also:
Constant Field Values

SHIFTMOD

public static final int SHIFTMOD
See Also:
Constant Field Values

LOG10

public static final float LOG10
Constructor Detail

GPlot

public GPlot(PApplet parent,
             float xPos,
             float yPos,
             float plotWidth,
             float plotHeight)
GPlot constructor

Parameters:
parent - the parent Processing applet
xPos - the plot x position on the screen
yPos - the plot y position on the screen
plotWidth - the plot width (x outer dimension)
plotHeight - the plot height (y outer dimension)

GPlot

public GPlot(PApplet parent,
             float xPos,
             float yPos)
GPlot constructor

Parameters:
parent - the parent Processing applet
xPos - the plot x position on the screen
yPos - the plot y position on the screen

GPlot

public GPlot(PApplet parent)
GPlot constructor

Parameters:
parent - the parent Processing applet
Method Detail

addLayer

public void addLayer(GLayer newLayer)
Adds a layer to the plot

Parameters:
newLayer - the layer to add

addLayer

public void addLayer(String id,
                     GPointsArray points)
Adds a new layer to the plot

Parameters:
id - the id to use for the new layer
points - the points to be included in the layer

removeLayer

public void removeLayer(String id)
Removes an exiting layer from the plot, provided it is not the plot main layer

Parameters:
id - the id of the layer to remove

getPlotPosAt

public float[] getPlotPosAt(float xScreen,
                            float yScreen)
Calculates the position of a point in the screen, relative to the plot reference system

Parameters:
xScreen - x screen position in the parent Processing applet
yScreen - y screen position in the parent Processing applet
Returns:
the x and y positions in the plot reference system

getScreenPosAtValue

public float[] getScreenPosAtValue(float xValue,
                                   float yValue)
Calculates the position of a given (x, y) point in the parent Processing applet screen

Parameters:
xValue - the x value
yValue - the y value
Returns:
the position of the (x, y) point in the parent Processing applet screen

getPointAt

public GPoint getPointAt(float xScreen,
                         float yScreen)
Returns the closest point in the main layer to a given screen position

Parameters:
xScreen - x screen position in the parent Processing applet
yScreen - y screen position in the parent Processing applet
Returns:
the closest point in the plot main layer. Null if there is not a close point

getPointAt

public GPoint getPointAt(float xScreen,
                         float yScreen,
                         String layerId)
Returns the closest point in the specified layer to a given screen position

Parameters:
xScreen - x screen position in the parent Processing applet
yScreen - y screen position in the parent Processing applet
layerId - the layer id
Returns:
the closest point in the specified layer. Null if there is not a close point

addPointAt

public void addPointAt(float xScreen,
                       float yScreen)
Adds a point to the main layer at a given screen position

Parameters:
xScreen - x screen position in the parent Processing applet
yScreen - y screen position in the parent Processing applet

addPointAt

public void addPointAt(float xScreen,
                       float yScreen,
                       String layerId)
Adds a point to the specified layer at a given screen position

Parameters:
xScreen - x screen position in the parent Processing applet
yScreen - y screen position in the parent Processing applet
layerId - the layer id

removePointAt

public void removePointAt(float xScreen,
                          float yScreen)
Removes a point from the main layer at a given screen position

Parameters:
xScreen - x screen position in the parent Processing applet
yScreen - y screen position in the parent Processing applet

removePointAt

public void removePointAt(float xScreen,
                          float yScreen,
                          String layerId)
Removes a point from the specified layer at a given screen position

Parameters:
xScreen - x screen position in the parent Processing applet
yScreen - y screen position in the parent Processing applet
layerId - the layer id

getValueAt

public float[] getValueAt(float xScreen,
                          float yScreen)
Returns the plot value at a given screen position

Parameters:
xScreen - x screen position in the parent Processing applet
yScreen - y screen position in the parent Processing applet
Returns:
the plot value

getRelativePlotPosAt

public float[] getRelativePlotPosAt(float xScreen,
                                    float yScreen)
Returns the relative plot position of a given screen position

Parameters:
xScreen - x screen position in the parent Processing applet
yScreen - y screen position in the parent Processing applet
Returns:
the relative position in the plot reference system

isOverPlot

public boolean isOverPlot(float xScreen,
                          float yScreen)
Indicates if a given screen position is inside the main plot area

Parameters:
xScreen - x screen position in the parent Processing applet
yScreen - y screen position in the parent Processing applet
Returns:
true if the position is inside the main plot area

isOverBox

public boolean isOverBox(float xScreen,
                         float yScreen)
Indicates if a given screen position is inside the plot box area

Parameters:
xScreen - x screen position in the parent Processing applet
yScreen - y screen position in the parent Processing applet
Returns:
true if the position is inside the plot box area

updateLimits

public void updateLimits()
Calculates and updates the plot x and y limits


calculatePointsXLim

public float[] calculatePointsXLim(GPointsArray points)
Calculates the x limits of a given set of points, considering the plot properties (axis log scale, if the other axis limits are fixed, etc)

Parameters:
points - the points for which we want to calculate the x limits
Returns:
the x limits. Null if none of the points satisfies the plot properties

calculatePointsYLim

public float[] calculatePointsYLim(GPointsArray points)
Calculates the y limits of a given set of points, considering the plot properties (axis log scale, if the other axis limits are fixed, etc)

Parameters:
points - the points for which we want to calculate the y limSits
Returns:
the y limits. Null if none of the points satisfies the plot properties

moveHorizontalAxesLim

public void moveHorizontalAxesLim(float delta)
Moves the horizontal axes limits by a given amount specified in pixel units

Parameters:
delta - pixels to move

moveVerticalAxesLim

public void moveVerticalAxesLim(float delta)
Moves the vertical axes limits by a given amount specified in pixel units

Parameters:
delta - pixels to move

centerAndZoom

public void centerAndZoom(float factor,
                          float xValue,
                          float yValue)
Centers the plot coordinates on the specified (x, y) point and zooms the limits range by a given factor

Parameters:
factor - the plot limits will be zoomed by this factor
xValue - the x plot value
yValue - the y plot value

zoom

public void zoom(float factor)
Zooms the limits range by a given factor

Parameters:
factor - the plot limits will be zoomed by this factor

zoom

public void zoom(float factor,
                 float xScreen,
                 float yScreen)
Zooms the limits range by a given factor keeping the same plot value at the specified screen position

Parameters:
factor - the plot limits will be zoomed by this factor
xScreen - x screen position in the parent Processing applet
yScreen - y screen position in the parent Processing applet

align

public void align(float xValue,
                  float yValue,
                  float xScreen,
                  float yScreen)
Shifts the plot coordinates in a way that after that the given plot value will be at the specified screen position

Parameters:
xValue - the x plot value
yValue - the y plot value
xScreen - x screen position in the parent Processing applet
yScreen - y screen position in the parent Processing applet

align

public void align(float[] value,
                  float xScreen,
                  float yScreen)
Shifts the plot coordinates in a way that after that the given plot value will be at the specified screen position

Parameters:
value - the x and y plot values
xScreen - x screen position in the parent Processing applet
yScreen - y screen position in the parent Processing applet

center

public void center(float xScreen,
                   float yScreen)
Centers the plot coordinates at the plot value that is at the specified screen position

Parameters:
xScreen - x screen position in the parent Processing applet
yScreen - y screen position in the parent Processing applet

startHistograms

public void startHistograms(int histType)
Initializes the histograms in all the plot layers

Parameters:
histType - the type of histogram to use. It can be GPlot.VERTICAL or GPlot.HORIZONTAL

defaultDraw

public void defaultDraw()
Draws the plot on the screen with default parameters


beginDraw

public void beginDraw()
Prepares the environment to start drawing the different plot components (points, axes, title, etc). Use endDraw() to return the sketch to its original state


endDraw

public void endDraw()
Returns the sketch to the state that it had before calling beginDraw()


drawBackground

public void drawBackground()
Draws the plot background. This includes the box area and the margins


drawBox

public void drawBox()
Draws the box area. This doesn't include the plot margins


drawXAxis

public void drawXAxis()
Draws the x axis


drawTopAxis

public void drawTopAxis()
Draws the top axis


drawYAxis

public void drawYAxis()
Draws the y axis


drawRightAxis

public void drawRightAxis()
Draws the right axis


drawTitle

public void drawTitle()
Draws the title


drawPoints

public void drawPoints()
Draws the points from all layers in the plot


drawPoints

public void drawPoints(PShape pointShape)
Draws the points from all layers in the plot

Parameters:
pointShape - the shape that should be used to represent the points

drawPoints

public void drawPoints(PImage pointImg)
Draws the points from all layers in the plot

Parameters:
pointImg - the image that should be used to represent the points

drawPoint

public void drawPoint(GPoint point,
                      int pointColor,
                      float pointSize)
Draws a point in the plot

Parameters:
point - the point to draw
pointColor - color to use
pointSize - point size in pixels

drawPoint

public void drawPoint(GPoint point)
Draws a point in the plot

Parameters:
point - the point to draw

drawPoint

public void drawPoint(GPoint point,
                      PShape pointShape)
Draws a point in the plot

Parameters:
point - the point to draw
pointShape - the shape that should be used to represent the point

drawPoint

public void drawPoint(GPoint point,
                      PShape pointShape,
                      int pointColor)
Draws a point in the plot

Parameters:
point - the point to draw
pointShape - the shape that should be used to represent the points
pointColor - color to use

drawPoint

public void drawPoint(GPoint point,
                      PImage pointImg)
Draws a point in the plot

Parameters:
point - the point to draw
pointImg - the image that should be used to represent the point

drawLines

public void drawLines()
Draws lines connecting the points from all layers in the plot


drawLine

public void drawLine(GPoint point1,
                     GPoint point2,
                     int lineColor,
                     float lineWidth)
Draws a line in the plot, defined by two extreme points

Parameters:
point1 - first point
point2 - second point
lineColor - line color
lineWidth - line width

drawLine

public void drawLine(GPoint point1,
                     GPoint point2)
Draws a line in the plot, defined by two extreme points

Parameters:
point1 - first point
point2 - second point

drawLine

public void drawLine(float slope,
                     float yCut,
                     int lineColor,
                     float lineWidth)
Draws a line in the plot, defined by the slope and the cut in the y axis

Parameters:
slope - the line slope
yCut - the line y axis cut
lineColor - line color
lineWidth - line width

drawLine

public void drawLine(float slope,
                     float yCut)
Draws a line in the plot, defined by the slope and the cut in the y axis

Parameters:
slope - the line slope
yCut - the line y axis cut

drawHorizontalLine

public void drawHorizontalLine(float value,
                               int lineColor,
                               float lineWidth)
Draws an horizontal line in the plot

Parameters:
value - line horizontal value
lineColor - line color
lineWidth - line width

drawHorizontalLine

public void drawHorizontalLine(float value)
Draws an horizontal line in the plot

Parameters:
value - line horizontal value

drawVerticalLine

public void drawVerticalLine(float value,
                             int lineColor,
                             float lineWidth)
Draws a vertical line in the plot

Parameters:
value - line vertical value
lineColor - line color
lineWidth - line width

drawVerticalLine

public void drawVerticalLine(float value)
Draws a vertical line in the plot

Parameters:
value - line vertical value

drawFilledContours

public void drawFilledContours(int contourType,
                               float referenceValue)
Draws filled contours connecting the points from all layers in the plot and a reference value

Parameters:
contourType - the type of contours to use. It can be GPlot.VERTICAL or GPlot.HORIZONTAL
referenceValue - the reference value to use to close the contour

drawLabel

public void drawLabel(GPoint point)
Draws the label of a given point

Parameters:
point - the point

drawLabelsAt

public void drawLabelsAt(float xScreen,
                         float yScreen)
Draws the labels of the points in the layers that are close to a given screen position

Parameters:
xScreen - x screen position in the parent Processing applet
yScreen - y screen position in the parent Processing applet

drawLabels

public void drawLabels()
Draws the labels of the points in the layers that are close to the mouse position. In order to work, you need to activate first the points labeling with the command plot.activatePointLabels()


drawGridLines

public void drawGridLines(int gridType)
Draws lines connecting the horizontal and vertical axis ticks

Parameters:
gridType - the type of grid to use. It could be GPlot.HORIZONTAL, GPlot.VERTICAL or GPlot.BOTH

drawHistograms

public void drawHistograms()
Draws the histograms of all layers


drawPolygon

public void drawPolygon(GPointsArray polygonPoints,
                        int polygonColor)
Draws a polygon defined by a set of points

Parameters:
polygonPoints - the points that define the polygon
polygonColor - the color to use to draw the polygon (contour and background)

drawAnnotation

public void drawAnnotation(String text,
                           float x,
                           float y,
                           int horAlign,
                           int verAlign)
Draws an annotation at a given plot value

Parameters:
text - the annotation text
x - x plot value
y - y plot value
horAlign - text horizontal alignment. It can be RIGHT, LEFT or CENTER
verAlign - text vertical alignment. It can be TOP, BOTTOM or CENTER

drawLegend

public void drawLegend(String[] text,
                       float[] xRelativePos,
                       float[] yRelativePos)
Draws a legend at the specified relative position

Parameters:
text - the text to use for each layer in the plot
xRelativePos - the plot x relative position for each layer in the plot
yRelativePos - the plot y relative position for each layer in the plot

setPos

public void setPos(float x,
                   float y)
Sets the plot position

Parameters:
x - the new plot x position on the screen
y - the new plot y position on the screen

setPos

public void setPos(float[] newPos)
Sets the plot position

Parameters:
newPos - the new plot (x, y) position

setOuterDim

public void setOuterDim(float xOuterDim,
                        float yOuterDim)
Sets the plot outer dimensions

Parameters:
xOuterDim - the new plot x outer dimension
yOuterDim - the new plot y outer dimension

setOuterDim

public void setOuterDim(float[] newOuterDim)
Sets the plot outer dimensions

Parameters:
newOuterDim - the new plot outer dimensions

setMar

public void setMar(float bottomMargin,
                   float leftMargin,
                   float topMargin,
                   float rightMargin)
Sets the plot margins

Parameters:
bottomMargin - the new plot bottom margin
leftMargin - the new plot left margin
topMargin - the new plot top margin
rightMargin - the new plot right margin

setMar

public void setMar(float[] newMar)
Sets the plot margins

Parameters:
newMar - the new plot margins

setDim

public void setDim(float xDim,
                   float yDim)
Sets the plot box dimensions

Parameters:
xDim - the new plot box x dimension
yDim - the new plot box y dimension

setDim

public void setDim(float[] newDim)
Sets the plot box dimensions

Parameters:
newDim - the new plot box dimensions

setXLim

public void setXLim(float lowerLim,
                    float upperLim)
Sets the horizontal axes limits

Parameters:
lowerLim - the new axes lower limit
upperLim - the new axes upper limit

setXLim

public void setXLim(float[] newXLim)
Sets the horizontal axes limits

Parameters:
newXLim - the new horizontal axes limits

setYLim

public void setYLim(float lowerLim,
                    float upperLim)
Sets the vertical axes limits

Parameters:
lowerLim - the new axes lower limit
upperLim - the new axes upper limit

setYLim

public void setYLim(float[] newYLim)
Sets the vertical axes limits

Parameters:
newYLim - the new vertical axes limits

setFixedXLim

public void setFixedXLim(boolean newFixedXLim)
Sets if the horizontal axes limits are fixed or not

Parameters:
newFixedXLim - the fixed condition for the horizontal axes

setFixedYLim

public void setFixedYLim(boolean newFixedYLim)
Sets if the vertical axes limits are fixed or not

Parameters:
newFixedYLim - the fixed condition for the vertical axes

setLogScale

public void setLogScale(String logType)
Sets if the scale for the horizontal and vertical axes is logarithmic or not

Parameters:
logType - the type of scale for the horizontal and vertical axes

setInvertedXScale

public void setInvertedXScale(boolean newInvertedXScale)
Sets if the scale of the horizontal axes should be inverted or not

Parameters:
newInvertedXScale - true if the horizontal scale should be inverted

invertXScale

public void invertXScale()
Inverts the horizontal axes scale


setInvertedYScale

public void setInvertedYScale(boolean newInvertedYScale)
Sets if the scale of the vertical axes should be inverted or not

Parameters:
newInvertedYScale - true if the vertical scale should be inverted

invertYScale

public void invertYScale()
Inverts the vertical axes scale


setIncludeAllLayersInLim

public void setIncludeAllLayersInLim(boolean includeAllLayers)
Sets if all the plot layers should be considered in the axes limits calculation

Parameters:
includeAllLayers - true if all layers should be considered and not only the main layer

setExpandLimFactor

public void setExpandLimFactor(float expandFactor)
Sets the factor that is used to expand the axes limits

Parameters:
expandFactor - the new expansion factor

setBgColor

public void setBgColor(int newBgColor)
Sets the plot background color

Parameters:
newBgColor - the new plot background color

setBoxBgColor

public void setBoxBgColor(int newBoxBgColor)
Sets the box background color

Parameters:
newBoxBgColor - the new box background color

setBoxLineColor

public void setBoxLineColor(int newBoxLineColor)
Sets the box line color

Parameters:
newBoxLineColor - the new box background color

setBoxLineWidth

public void setBoxLineWidth(float newBoxLineWidth)
Sets the box line width

Parameters:
newBoxLineWidth - the new box line width

setGridLineColor

public void setGridLineColor(int newGridLineColor)
Sets the grid line color

Parameters:
newGridLineColor - the new grid line color

setGridLineWidth

public void setGridLineWidth(float newGridLineWidth)
Sets the grid line width

Parameters:
newGridLineWidth - the new grid line width

setPoints

public void setPoints(GPointsArray points)
Sets the points for the main layer

Parameters:
points - the new points for the main layer

setPoints

public void setPoints(GPointsArray points,
                      String layerId)
Sets the points for the specified layer

Parameters:
points - the new points for the main layer
layerId - the layer id

setPoint

public void setPoint(int index,
                     float x,
                     float y,
                     String label)
Sets one of the main layer points

Parameters:
index - the point position
x - the point new x coordinate
y - the point new y coordinate
label - the point new label

setPoint

public void setPoint(int index,
                     float x,
                     float y,
                     String label,
                     String layerId)
Sets one of the specified layer points

Parameters:
index - the point position
x - the point new x coordinate
y - the point new y coordinate
label - the point new label
layerId - the layer id

setPoint

public void setPoint(int index,
                     float x,
                     float y)
Sets one of the main layer points

Parameters:
index - the point position
x - the point new x coordinate
y - the point new y coordinate

setPoint

public void setPoint(int index,
                     GPoint newPoint)
Sets one of the main layer points

Parameters:
index - the point position
newPoint - the new point

setPoint

public void setPoint(int index,
                     GPoint newPoint,
                     String layerId)
Sets one of the specified layer points

Parameters:
index - the point position
newPoint - the new point
layerId - the layer id

addPoint

public void addPoint(float x,
                     float y,
                     String label)
Adds a new point to the main layer points

Parameters:
x - the new point x coordinate
y - the new point y coordinate
label - the new point label

addPoint

public void addPoint(float x,
                     float y,
                     String label,
                     String layerId)
Adds a new point to the specified layer points

Parameters:
x - the new point x coordinate
y - the new point y coordinate
label - the new point label
layerId - the layer id

addPoint

public void addPoint(float x,
                     float y)
Adds a new point to the main layer points

Parameters:
x - the new point x coordinate
y - the new point y coordinate

addPoint

public void addPoint(GPoint newPoint)
Adds a new point to the main layer points

Parameters:
newPoint - the point to add

addPoint

public void addPoint(GPoint newPoint,
                     String layerId)
Adds a new point to the specified layer points

Parameters:
newPoint - the point to add
layerId - the layer id

addPoint

public void addPoint(int index,
                     float x,
                     float y,
                     String label)
Adds a new point to the main layer points

Parameters:
index - the position to add the point
x - the new point x coordinate
y - the new point y coordinate
label - the new point label

addPoint

public void addPoint(int index,
                     float x,
                     float y,
                     String label,
                     String layerId)
Adds a new point to the specified layer points

Parameters:
index - the position to add the point
x - the new point x coordinate
y - the new point y coordinate
label - the new point label
layerId - the layer id

addPoint

public void addPoint(int index,
                     float x,
                     float y)
Adds a new point to the main layer points

Parameters:
index - the position to add the point
x - the new point x coordinate
y - the new point y coordinate

addPoint

public void addPoint(int index,
                     GPoint newPoint)
Adds a new point to the main layer points

Parameters:
index - the position to add the point
newPoint - the point to add

addPoint

public void addPoint(int index,
                     GPoint newPoint,
                     String layerId)
Adds a new point to the specified layer points

Parameters:
index - the position to add the point
newPoint - the point to add
layerId - the layer id

addPoints

public void addPoints(GPointsArray newPoints)
Adds new points to the main layer points

Parameters:
newPoints - the points to add

addPoints

public void addPoints(GPointsArray newPoints,
                      String layerId)
Adds new points to the specified layer points

Parameters:
newPoints - the points to add
layerId - the layer id

removePoint

public void removePoint(int index)
Removes one of the main layer points

Parameters:
index - the point position

removePoint

public void removePoint(int index,
                        String layerId)
Removes one of the specified layer points

Parameters:
index - the point position
layerId - the layer id

setPointColors

public void setPointColors(int[] pointColors)
Sets the point colors for the main layer

Parameters:
pointColors - the point colors for the main layer

setPointColor

public void setPointColor(int pointColor)
Sets the point color for the main layer

Parameters:
pointColor - the point color for the main layer

setPointSizes

public void setPointSizes(float[] pointSizes)
Sets the point sizes for the main layer

Parameters:
pointSizes - the point sizes for the main layer

setPointSize

public void setPointSize(float pointSize)
Sets the point size for the main layer

Parameters:
pointSize - the point sizes for the main layer

setLineColor

public void setLineColor(int lineColor)
Sets the line color for the main layer

Parameters:
lineColor - the line color for the main layer

setLineWidth

public void setLineWidth(float lineWidth)
Sets the line width for the main layer

Parameters:
lineWidth - the line with for the main layer

setHistBasePoint

public void setHistBasePoint(GPoint basePoint)
Sets the base point for the histogram in the main layer

Parameters:
basePoint - the base point for the histogram in the main layer

setHistType

public void setHistType(int histType)
Sets the histogram type for the histogram in the main layer

Parameters:
histType - the histogram type for the histogram in the main layer. It can be GPlot.HORIZONTAL or GPlot.VERTICAL

setHistVisible

public void setHistVisible(boolean visible)
Sets if the histogram in the main layer is visible or not

Parameters:
visible - if true, the histogram is visible

setDrawHistLabels

public void setDrawHistLabels(boolean drawHistLabels)
Sets if the labels of the histogram in the main layer will be drawn or not

Parameters:
drawHistLabels - if true, the histogram labels will be drawn

setLabelBgColor

public void setLabelBgColor(int labelBgColor)
Sets the label background color of the points in the main layer

Parameters:
labelBgColor - the label background color of the points in the main layer

setLabelSeparation

public void setLabelSeparation(float[] labelSeparation)
Sets the label separation of the points in the main layer

Parameters:
labelSeparation - the label separation of the points in the main layer

setTitleText

public void setTitleText(String text)
Set the plot title text

Parameters:
text - the plot title text

setAxesOffset

public void setAxesOffset(float offset)
Sets the axis offset for all the axes in the plot

Parameters:
offset - the new axis offset

setTicksLength

public void setTicksLength(float tickLength)
Sets the tick length for all the axes in the plot

Parameters:
tickLength - the new tick length

setHorizontalAxesNTicks

public void setHorizontalAxesNTicks(int nTicks)
Sets the approximate number of ticks in the horizontal axes. The actual number of ticks depends on the axes limits and the axes scale

Parameters:
nTicks - the new approximate number of ticks in the horizontal axes

setHorizontalAxesTicksSeparation

public void setHorizontalAxesTicksSeparation(float ticksSeparation)
Sets the separation between the ticks in the horizontal axes

Parameters:
ticksSeparation - the new ticks separation in the horizontal axes

setHorizontalAxesTicks

public void setHorizontalAxesTicks(float[] ticks)
Sets the horizontal axes ticks

Parameters:
ticks - the new horizontal axes ticks

setVerticalAxesNTicks

public void setVerticalAxesNTicks(int nTicks)
Sets the approximate number of ticks in the vertical axes. The actual number of ticks depends on the axes limits and the axes scale

Parameters:
nTicks - the new approximate number of ticks in the vertical axes

setVerticalAxesTicksSeparation

public void setVerticalAxesTicksSeparation(float ticksSeparation)
Sets the separation between the ticks in the vertical axes

Parameters:
ticksSeparation - the new ticks separation in the vertical axes

setVerticalAxesTicks

public void setVerticalAxesTicks(float[] ticks)
Sets the vertical axes ticks

Parameters:
ticks - the new vertical axes ticks

setFontName

public void setFontName(String fontName)
Sets the name of the font that is used in the main layer

Parameters:
fontName - the name of the font that will be used in the main layer

setFontColor

public void setFontColor(int fontColor)
Sets the color of the font that is used in the main layer

Parameters:
fontColor - the color of the font that will be used in the main layer

setFontSize

public void setFontSize(int fontSize)
Sets the size of the font that is used in the main layer

Parameters:
fontSize - the size of the font that will be used in the main layer

setFontProperties

public void setFontProperties(String fontName,
                              int fontColor,
                              int fontSize)
Sets the properties of the font that is used in the main layer

Parameters:
fontName - the name of the font that will be used in the main layer
fontColor - the color of the font that will be used in the main layer
fontSize - the size of the font that will be used in the main layer

setAllFontProperties

public void setAllFontProperties(String fontName,
                                 int fontColor,
                                 int fontSize)
Sets the properties of the font that will be used in all plot elements (layer, axes, title, histogram)

Parameters:
fontName - the name of the font that will be used in all plot elements
fontColor - the color of the font that will be used in all plot elements
fontSize - the size of the font that will be used in all plot elements

getPos

public float[] getPos()
Returns the plot position

Returns:
the plot position

getOuterDim

public float[] getOuterDim()
Returns the plot outer dimensions

Returns:
the plot outer dimensions

getMar

public float[] getMar()
Returns the plot margins

Returns:
the plot margins

getDim

public float[] getDim()
Returns the box dimensions

Returns:
the box dimensions

getXLim

public float[] getXLim()
Returns the limits of the horizontal axes

Returns:
the limits of the horizontal axes

getYLim

public float[] getYLim()
Returns the limits of the vertical axes

Returns:
the limits of the vertical axes

getFixedXLim

public boolean getFixedXLim()
Returns true if the horizontal axes limits are fixed

Returns:
true, if the horizontal axes limits are fixed

getFixedYLim

public boolean getFixedYLim()
Returns true if the vertical axes limits are fixed

Returns:
true, if the vertical axes limits are fixed

getXLog

public boolean getXLog()
Returns true if the horizontal axes scale is logarithmic

Returns:
true, if the horizontal axes scale is logarithmic

getYLog

public boolean getYLog()
Returns true if the vertical axes scale is logarithmic

Returns:
true, if the vertical axes scale is logarithmic

getInvertedXScale

public boolean getInvertedXScale()
Returns true if the horizontal axes limits are inverted

Returns:
true, if the horizontal axes limits are inverted

getInvertedYScale

public boolean getInvertedYScale()
Returns true if the vertical axes limits are inverted

Returns:
true, if the vertical axes limits are inverted

getMainLayer

public GLayer getMainLayer()
Returns the plot main layer

Returns:
the plot main layer

getLayer

public GLayer getLayer(String id)
Returns a layer with an specific id

Parameters:
id - the id of the layer to return
Returns:
the layer with the specified id

getXAxis

public GAxis getXAxis()
Returns the plot x axis

Returns:
the plot x axis

getTopAxis

public GAxis getTopAxis()
Returns the plot top axis

Returns:
the plot top axis

getYAxis

public GAxis getYAxis()
Returns the plot y axis

Returns:
the plot y axis

getRightAxis

public GAxis getRightAxis()
Returns the plot right axis

Returns:
the plot right axis

getTitle

public GTitle getTitle()
Returns the plot title

Returns:
the plot title

getPoints

public GPointsArray getPoints()
Returns a copy of the points of the main layer

Returns:
a copy of the points of the main layer

getPoints

public GPointsArray getPoints(String layerId)
Returns a copy of the points of the specified layer

Parameters:
layerId - the layer id
Returns:
a copy of the points of the specified layer

getPointsRef

public GPointsArray getPointsRef()
Returns the points of the main layer

Returns:
the points of the main layer

getPointsRef

public GPointsArray getPointsRef(String layerId)
Returns the points of the specified layer

Parameters:
layerId - the layer id
Returns:
the points of the specified layer

getHistogram

public GHistogram getHistogram()
Returns the histogram of the main layer

Returns:
the histogram of the main layer

getHistogram

public GHistogram getHistogram(String layerId)
Returns the histogram of the specified layer

Parameters:
layerId - the layer id
Returns:
the histogram of the specified layer

activateZooming

public void activateZooming(float factor,
                            int increaseButton,
                            int decreaseButton,
                            int increaseKeyModifier,
                            int decreaseKeyModifier)
Activates the option to zoom with the mouse using the specified buttons and the specified key modifiers

Parameters:
factor - the zoom factor to increase or decrease with each mouse click
increaseButton - the mouse button to increase the zoom. It could be LEFT, RIGHT or CENTER. Select CENTER to use the mouse wheel
decreaseButton - the mouse button to decrease the zoom. It could be LEFT, RIGHT or CENTER. Select CENTER to use the mouse wheel
increaseKeyModifier - the key modifier to use in conjunction with the increase zoom mouse button. It could be GPlot.SHIFTMOD, GPlot.CTRLMOD, GPlot.METAMOD, GPlot.ALTMOD, or GPlot.NONE if no key is needed
decreaseKeyModifier - the key modifier to use in conjunction with the decrease zoom mouse button. It could be GPlot.SHIFTMOD, GPlot.CTRLMOD, GPlot.METAMOD, GPlot.ALTMOD, or GPlot.NONE if no key is needed

activateZooming

public void activateZooming(float factor,
                            int increaseButton,
                            int decreaseButton)
Activates the option to zoom with the mouse using the specified buttons

Parameters:
factor - the zoom factor to increase or decrease with each mouse click
increaseButton - the mouse button to increase the zoom. It could be LEFT, RIGHT or CENTER. Select CENTER to use the mouse wheel
decreaseButton - the mouse button to decrease the zoom. It could be LEFT, RIGHT or CENTER. Select CENTER to use the mouse wheel

activateZooming

public void activateZooming(float factor)
Activates the option to zoom with the mouse using the LEFT and RIGHT buttons

Parameters:
factor - the zoom factor to increase or decrease with each mouse click

activateZooming

public void activateZooming()
Activates the option to zoom with the mouse using the LEFT and RIGHT buttons


deactivateZooming

public void deactivateZooming()
Deactivates the option to zoom with the mouse


activateCentering

public void activateCentering(int button,
                              int keyModifier)
Activates the option to center the plot with the mouse using the specified button and the specified key modifier

Parameters:
button - the mouse button to use. It could be LEFT, RIGHT or CENTER. Select CENTER to use the mouse wheel
keyModifier - the key modifier to use in conjunction with the mouse button. It could be GPlot.SHIFTMOD, GPlot.CTRLMOD, GPlot.METAMOD, GPlot.ALTMOD, or GPlot.NONE if no key is need

activateCentering

public void activateCentering(int button)
Activates the option to center the plot with the mouse using the specified button

Parameters:
button - the mouse button to use. It could be LEFT, RIGHT or CENTER. Select CENTER to use the mouse wheel

activateCentering

public void activateCentering()
Activates the option to center the plot with the mouse using the LEFT button


deactivateCentering

public void deactivateCentering()
Deactivates the option to center the plot with the mouse


activatePanning

public void activatePanning(int button,
                            int keyModifier)
Activates the option to pan the plot with the mouse using the specified button and the specified key modifier

Parameters:
button - the mouse button to use. It could be LEFT, RIGHT or CENTER
keyModifier - the key modifier to use in conjunction with the mouse button. It could be GPlot.SHIFTMOD, GPlot.CTRLMOD, GPlot.METAMOD, GPlot.ALTMOD, or GPlot.NONE if no key is need

activatePanning

public void activatePanning(int button)
Activates the option to pan the plot with the mouse using the specified button

Parameters:
button - the mouse button to use. It could be LEFT, RIGHT or CENTER

activatePanning

public void activatePanning()
Activates the option to pan the plot with the mouse using the LEFT button


deactivatePanning

public void deactivatePanning()
Deactivates the option to pan the plot with the mouse


activatePointLabels

public void activatePointLabels(int button,
                                int keyModifier)
Activates the option to draw the labels of the points with the mouse using the specified button and the specified key modifier

Parameters:
button - the mouse button to use. It could be LEFT, RIGHT or CENTER
keyModifier - the key modifier to use in conjunction with the mouse button. It could be GPlot.SHIFTMOD, GPlot.CTRLMOD, GPlot.METAMOD, GPlot.ALTMOD, or GPlot.NONE if no key is need

activatePointLabels

public void activatePointLabels(int button)
Activates the option to draw the labels of the points with the mouse using the specified button

Parameters:
button - the mouse button to use. It could be LEFT, RIGHT or CENTER

activatePointLabels

public void activatePointLabels()
Activates the option to draw the labels of the points with the mouse using the LEFT button


deactivatePointLabels

public void deactivatePointLabels()
Deactivates the option to draw the labels of the points with the mouse


activateReset

public void activateReset(int button,
                          int keyModifier)
Activates the option to return to the value of the axes limits previous to any mouse interaction, using the specified button and the specified key modifier

Parameters:
button - the mouse button to use. It could be LEFT, RIGHT or CENTER. Select CENTER to use the mouse wheel
keyModifier - the key modifier to use in conjunction with the mouse button. It could be GPlot.SHIFTMOD, GPlot.CTRLMOD, GPlot.METAMOD, GPlot.ALTMOD, or GPlot.NONE if no key is need

activateReset

public void activateReset(int button)
Activates the option to return to the value of the axes limits previous to any mouse interaction, using the specified button

Parameters:
button - the mouse button to use. It could be LEFT, RIGHT or CENTER. Select CENTER to use the mouse wheel

activateReset

public void activateReset()
Activates the option to return to the value of the axes limits previous to any mouse interaction, using the RIGHT button


deactivateReset

public void deactivateReset()
Deactivates the option to return to the value of the axes limits previous to any mouse interaction using the mouse


mouseEvent

public void mouseEvent(MouseEvent event)
Mouse events (zooming, centering, panning, labeling)

Parameters:
event - the mouse event detected by the processing applet


Processing library grafica by Javier Gracia Carpio. (c) 2013