|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Canvas | +--CGrafica
Clase usada para dibujar curvas de datos con una rejilla vertical y una horizontal en un canvas. Utiliza "double buffering" para evitar parpadeo al dibujar las curvas.
Inner Class Summary | |
class |
CGrafica.CDatosCurvas
Clase que contiene los datos y el color de una curva. |
Inner classes inherited from class java.awt.Canvas |
java.awt.Canvas.AccessibleAWTCanvas |
Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.AWTTreeLock |
Field Summary | |
private java.util.Vector |
curvas
|
private java.awt.Graphics |
g
|
private java.lang.String |
grafTitle
|
private java.lang.String |
grafTitleRoot
|
private java.awt.Canvas |
lienzo
|
private long |
max_y
|
private int |
min_x
|
private long |
min_y
|
private java.awt.Graphics |
offScreenGraphics
|
private java.awt.Image |
offScreenImage
|
private java.awt.Dimension |
offScreenSize
|
private SolarTemplate |
parent
|
private int |
periodo_sim
|
private java.awt.Rectangle |
rcClient
|
private int |
scale_max_x
|
private int |
scale_max_y
|
private int |
scale_min_x
|
private int |
scale_min_y
|
private int |
x_grid
|
private int |
y_grid
|
Fields inherited from class java.awt.Canvas |
base, nameCounter, serialVersionUID |
Fields inherited from class java.awt.Component |
accessibleContext, actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, changeSupport, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dbg, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, graphicsConfig, hasFocus, height, hierarchyBoundsListener, hierarchyBoundsListenerK, hierarchyListener, hierarchyListenerK, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, metrics, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, peer, peerFont, popups, prefSize, privateKey, RIGHT_ALIGNMENT, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowClosingException, windowListenerK, x, y |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
CGrafica(java.awt.Graphics graf,
java.awt.Canvas canv,
java.lang.String title,
int NumberOfX,
int NumberOfY,
SolarTemplate rad)
Constructor de la clase CGrafica |
Method Summary | |
void |
AddCurve(double[] datos,
java.awt.Color color)
Añade una curva al gráfico que está siendo mostrado |
boolean |
AutoScale()
Establece la escala de las ordenadas, teniendo en cuenta los valores máximos de los datos a mostrar. |
private java.awt.Graphics |
checkGraphics()
Crea el entorno gráfico donde dibujar (si no ha sido creado ya) |
void |
Delete_Curves()
Elimina del vector curvas todos los datos |
void |
Delete_Graph()
Borra las curvas mostradas en pantalla. |
void |
drawaxis(java.awt.Graphics gr)
Dibuja los ejes y la cuadrícula. |
void |
DrawCurve(double[] datos,
java.awt.Color color,
java.awt.Graphics gr)
Dibuja las gráficas cuyos puntos son los datos pasados. |
void |
PaintGraph()
Dibuja un gráfico con los datos almacenados en la lista curvas. |
void |
prepareCurve(double[] datos,
java.awt.Color color)
Crea una nueva curva que será mostrada en pantalla cuando las demás curvas estén listas (aumentando así la eficiencia del programa). |
void |
SetAxis(int numberOfX,
int numberOfY,
int xIni,
int yIni,
int periodo)
Establece el número de la rejilla horizontal y vertical, así como los valores iniciales de las abscisas y las ordenadas. |
void |
SetGraphTitle(java.lang.String auxstring)
Establece el título del gráfico |
Methods inherited from class java.awt.Canvas |
|
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkGD, checkImage, checkImage, checkWindowClosingException, coalesceEvents, contains, contains, createChildHierarchyEvents, createHierarchyEvents, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, dispatchEventImpl, doLayout, enable, enable, enableEvents, enableInputMethods, eventEnabled, firePropertyChange, getAccessibleIndexInParent, getAccessibleStateSet, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen_NoTreeLock, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getToolkitImpl, getTreeLock, getWidth, getWindowForObject, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, initIDs, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isRecursivelyVisible, isShowing, isValid, isVisible, keyDown, keyUp, layout, lightweightPaint, lightweightPrint, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, numListening, paintAll, paintHeavyweightComponents, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, printHeavyweightComponents, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, readObject, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, resetGC, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate, writeObject |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait |
Field Detail |
private java.awt.Image offScreenImage
private java.awt.Dimension offScreenSize
private java.awt.Graphics offScreenGraphics
private SolarTemplate parent
private java.awt.Graphics g
private java.awt.Canvas lienzo
private long max_y
private long min_y
private int min_x
private java.lang.String grafTitle
private java.lang.String grafTitleRoot
private java.awt.Rectangle rcClient
private int scale_max_y
private int scale_min_y
private int scale_max_x
private int scale_min_x
private int x_grid
private int y_grid
private java.util.Vector curvas
private int periodo_sim
Constructor Detail |
public CGrafica(java.awt.Graphics graf, java.awt.Canvas canv, java.lang.String title, int NumberOfX, int NumberOfY, SolarTemplate rad)
graf
- canv
- canvas donde son dibujadas las curvas de datos.title
- título del gráficoNumberOfX
- número de líneas de la rejilla vertical (abscisas)NumberOfY
- número de líneas de la rejilla horizontal (ordenadas)rad
- Enlace a la clase de radiación solar.Method Detail |
public void drawaxis(java.awt.Graphics gr)
gr
- Elemento gráfico para utilizar double buffering.public void DrawCurve(double[] datos, java.awt.Color color, java.awt.Graphics gr)
datos
- Array de datos de cada curva.Color
- de la curva.Elemento
- gráfico para double buffering.public void Delete_Graph()
public void Delete_Curves()
public void SetAxis(int numberOfX, int numberOfY, int xIni, int yIni, int periodo)
numberOfX
- número de la rejilla verticalnumberOfY
- número de la rejilla horizontalxIni
- número inicial de las abscisasyIni
- número inicial de las ordenadasint
- periodo de simulación. 0: Diaria. 1: Mensual. 2: Anual.private java.awt.Graphics checkGraphics()
public boolean AutoScale()
public void AddCurve(double[] datos, java.awt.Color color)
datos
- valores de las ordenadas de la nueva curvacolor
- color de la nueva curvapublic void prepareCurve(double[] datos, java.awt.Color color)
datos
- valores de las ordenadas de la nueva curvacolor
- color de la nueva curvapublic void PaintGraph()
public void SetGraphTitle(java.lang.String auxstring)
auxstring
- título del gráfico
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |