yu.ac.bg.etf.javaqx.qswingx.text.code
Class CodeViewer

java.lang.Object
  extended byyu.ac.bg.etf.javaqx.core.AbstractDisposable
      extended byyu.ac.bg.etf.javaqx.qswing.JQComponent
          extended byyu.ac.bg.etf.javaqx.qswing.JQTextComponent
              extended byyu.ac.bg.etf.javaqx.qswing.JQTextArea
                  extended byyu.ac.bg.etf.javaqx.qswingx.text.code.CodeViewer
All Implemented Interfaces:
Disposable, JQComponentProperties, JQTextAreaProperties, JQTextComponentProperties

public class CodeViewer
extends JQTextArea

Code Viewer.

Version:
0.2.0
Author:
Slobodan Vrkacevic (slobodan.vrkacevic@gmail.com)

Field Summary
 
Fields inherited from class yu.ac.bg.etf.javaqx.qswing.JQComponent
listenerList
 
Fields inherited from interface yu.ac.bg.etf.javaqx.qswing.properties.JQTextAreaProperties
PROPERTY_WRAP_TEXT
 
Fields inherited from interface yu.ac.bg.etf.javaqx.qswing.properties.JQTextComponentProperties
PROPERTY_DOCUMENT, PROPERTY_EDITABLE
 
Fields inherited from interface yu.ac.bg.etf.javaqx.qswing.properties.JQComponentProperties
PROPERTY_BACKGROUND, PROPERTY_COMPONENT_ORIENTATION, PROPERTY_CONTEXT_MENU, PROPERTY_ENABLED, PROPERTY_FIXED_SIZE, PROPERTY_FOCUSABLE, PROPERTY_FONT, PROPERTY_FOREGROUND, PROPERTY_INSETS, PROPERTY_LOCALE, PROPERTY_MAXIMUM_SIZE, PROPERTY_MINIMUM_SIZE, PROPERTY_NAME, PROPERTY_OPAQUE, PROPERTY_PREFERRED_SIZE, PROPERTY_RESOURCE_BUNDLE_NAME, PROPERTY_STATUS_TIP_TEXT, PROPERTY_STYLE_SHEET, PROPERTY_TOOL_TIP_TEXT, PROPERTY_VISIBLE, PROPERTY_WHATS_THIS_TEXT
 
Constructor Summary
CodeViewer()
          Constructs new CodeViewer object.
CodeViewer(int marginWidth)
          Constructs new CodeViewer object.
CodeViewer(TextHighlighter highlighter)
          Constructs new CodeViewer object.
 
Method Summary
 Color getMarginColor()
          Returns the color of the margin.
 int getMarginWidth()
          Returns the width of the margin.
protected  void paintComponentView(Graphics g, int x, int y, int width, int height)
          Paints view.
protected  void processStyleChange()
          Process style change.
 void setEditable(boolean editable)
          Sets whether or not the text component is editable.
 void setFont(Font font)
          Sets component's font.
 void setMarginColor(Color marginColor)
          Sets the color of the margin.
 void setMarginWidth(int marginWidth)
          Sets the width of the margin.
 
Methods inherited from class yu.ac.bg.etf.javaqx.qswing.JQTextArea
getDocument, isWrapText, setDocument, setWrapText
 
Methods inherited from class yu.ac.bg.etf.javaqx.qswing.JQTextComponent
addEditListener, addUndoRedoListener, appendText, clear, clearText, copy, cut, fireClearAvailable, fireCopyAvailable, fireCutAvailable, firePasteAvailable, fireRedoAvailable, fireSelectAllAvailable, fireUndoAvailable, getEditListeners, getText, getUndoRedoListeners, insertText, isClearAvailable, isCopyAvailable, isCutAvailable, isEditable, isModified, isPasteAvailable, isRedoAvailable, isSelectAllAvailable, isUndoAvailable, paste, print, read, redo, removeEditListener, removeUndoRedoListener, selectAll, setModified, setText, undo, write
 
Methods inherited from class yu.ac.bg.etf.javaqx.qswing.JQComponent
addComponentListener, addFocusListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, disableEvents, disposeComponent, disposeObject, enableEvents, eventEnabled, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getClientProperty, getComponentListeners, getComponentOrientation, getContextMenu, getCursor, getEventMask, getFocusListener, getFont, getFontMetrics, getForeground, getHeight, getInsets, getKeyListeners, getLocale, getLocation, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getOwnedComponents, getOwner, getParent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getResourceBundleName, getSize, getStatusTipText, getStyleSheet, getToolTipText, getToolTipText, getWhatsThisText, getWidth, getX, getY, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFontSet, isForegroundSet, isLeftToRight, isLocaleSet, isOpaque, isOwnerOf, isPainting, isResizable, isResourceBundleNameSet, isUpdatesEnabled, isValid, isVisible, localizeObject, localizeString, localizeString, localizeStrings, paintComponent, paramString, processComponentEvent, processContextMenuEvent, processFocusEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, putClientProperty, removeComponentListener, removeFocusListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, removeStyleSheet, repaint, repaint, repaint, requestFocus, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setContextMenu, setCursor, setDefaultResourceBundleName, setDisplayable, setEnabled, setFixedSize, setFixedSize, setFocusable, setForeground, setInsets, setInsets, setLeftToRightComponentOrientation, setLocale, setLocation, setLocation, setMaximumSize, setMaximumSize, setMinimumSize, setMinimumSize, setName, setOpaque, setPreferredSize, setPreferredSize, setResizable, setResourceBundleName, setRightToLeftComponentOrientation, setSize, setSize, setStatusTipText, setStyleSheet, setStyleSheet, setToolTipText, setUpdatesEnabled, setVisible, setWhatsThisText, toString, unsetComponentOrientation, update, update, update, updateComponentOrientation, updateLocalization, validate
 
Methods inherited from class yu.ac.bg.etf.javaqx.core.AbstractDisposable
addDisposeListener, dispose, disposedCheck, disposedErrorString, finalize, isDisposed, removeDisposeListener
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CodeViewer

public CodeViewer()
Constructs new CodeViewer object.


CodeViewer

public CodeViewer(int marginWidth)
Constructs new CodeViewer object.

Parameters:
marginWidth - the width of the margin

CodeViewer

public CodeViewer(TextHighlighter highlighter)
Constructs new CodeViewer object.

Parameters:
highlighter - the document highlighter
Method Detail

getMarginWidth

public int getMarginWidth()
Returns the width of the margin.

Returns:
the width of the margin

setMarginWidth

public void setMarginWidth(int marginWidth)
Sets the width of the margin.

Parameters:
marginWidth - the width of the margin

getMarginColor

public Color getMarginColor()
Returns the color of the margin.

Returns:
the color of the margin

setMarginColor

public void setMarginColor(Color marginColor)
Sets the color of the margin.

Parameters:
marginColor - the color of the margin

setFont

public void setFont(Font font)
Sets component's font.

Overrides:
setFont in class JQComponent
Parameters:
font - the font

setEditable

public void setEditable(boolean editable)
Sets whether or not the text component is editable.

Overrides:
setEditable in class JQTextComponent
Parameters:
editable - true if editable

paintComponentView

protected void paintComponentView(Graphics g,
                                  int x,
                                  int y,
                                  int width,
                                  int height)
Paints view.

Overrides:
paintComponentView in class JQTextArea
Parameters:
g - the graphics object
x - the x-coordinate of the view
y - the y-coordinate of the view
width - the width of the view
height - the height of the view

processStyleChange

protected void processStyleChange()
Process style change.

Overrides:
processStyleChange in class JQComponent


Copyright © 2007 ETF and contributors. All Rights Reserved.