cz.cuni.mff.mirovsky.trees
Class NGForestPrint

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by cz.cuni.mff.mirovsky.trees.NGForestView
                  extended by cz.cuni.mff.mirovsky.trees.NGForestPrint
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class NGForestPrint
extends NGForestView

This class provides functions for printing trees on a printer.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class cz.cuni.mff.mirovsky.trees.NGForestView
font_size, forest, forest_height, forest_width, horizontal_space, kodovany, posunuti_textu_doleva, reference_patterns, show_hidden_nodes, tree_properties
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
NGForestPrint(ShowMessagesAble p_mess)
          Creates a new object for printing a forest on a printer
 
Method Summary
protected  java.awt.Color determineColor(TNode node, ReferencePattern pattern, java.lang.String value_depend_value)
          Sets the color for printing a reference.
protected  void drawDescription(java.awt.Graphics g, java.lang.String description, int x, int y)
          Draws a description of one attribute to one node.
 PrintTreeProperties getPrintProperties()
          Returns the print properties of the tree.
 void print(java.awt.Graphics2D g, double max_x, double max_y)
          Prints the forest to the graphic object g.
protected  void setGlobalProperties()
          Sets global variables for printing in accordance with the actual tree properties and print properties.
 void setPrintProperties(PrintTreeProperties new_properties)
          Sets the print properties of the tree.
 
Methods inherited from class cz.cuni.mff.mirovsky.trees.NGForestView
addTree, debug, drawTree, getEmphasizeChosenNode, getFlagForestChanged, getFontSize, getForest, getForestHeight, getForestWidth, getMatchingNodesRectangle, getReferencePatterns, getShowHiddenNodes, getTreeProperties, changeReferenceStatus, inform, paintComponent, printChosen, printReferences, setEmphasizeChosenNode, setFlagWholeForestChanged, setFontSize, setForest, setHorizontalSpace, setChosenNodeByDepthOrder, setReferencePatterns, setShowHiddenNodes, setTree, setTreeProperties, truncLemma, vypocti_nakresleni
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, 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, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printComponent, printChildren, 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, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, 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, hide, checkImage, checkImage, 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, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NGForestPrint

public NGForestPrint(ShowMessagesAble p_mess)
Creates a new object for printing a forest on a printer

Parameters:
p_mess - an object capable of printing messages
Method Detail

setGlobalProperties

protected void setGlobalProperties()
Sets global variables for printing in accordance with the actual tree properties and print properties.

Overrides:
setGlobalProperties in class NGForestView

drawDescription

protected void drawDescription(java.awt.Graphics g,
                               java.lang.String description,
                               int x,
                               int y)
Draws a description of one attribute to one node.

Overrides:
drawDescription in class NGForestView
Parameters:
g - Graphics object
description - the description to be drawn
x - x-coordinate
y - y-coordinate

setPrintProperties

public void setPrintProperties(PrintTreeProperties new_properties)
Sets the print properties of the tree.

Parameters:
new_properties - new print properties

getPrintProperties

public PrintTreeProperties getPrintProperties()
Returns the print properties of the tree.

Returns:
the print properties

print

public void print(java.awt.Graphics2D g,
                  double max_x,
                  double max_y)
Prints the forest to the graphic object g.

Parameters:
g - Graphics2D object to be drawn to
max_x - x-size of the printable area
max_y - y-size of the printable area

determineColor

protected java.awt.Color determineColor(TNode node,
                                        ReferencePattern pattern,
                                        java.lang.String value_depend_value)
Sets the color for printing a reference. May be black and white for printing on a printer, that is why the function is overridden here.

Overrides:
determineColor in class NGForestView
Parameters:
node -
pattern - a reference pattern
value_depend_value - the value of the attribute that may influence the color
Returns:
the color