|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel com.ngs.image.ImageCanvas
public class ImageCanvas
Used by the ImagePanel to render an ImageModel. ImageCanvas is aware of changes to the JViewport of the JScrollPane that contains it, and will set sub-clipping regions on the ImageModel for images larger than the size of the canvas.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected ImageModel |
model
|
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 | |
---|---|
ImageCanvas()
|
Method Summary | |
---|---|
protected boolean |
allowClippedMode()
If true, then if we are added as a ChangeListener to a JViewport, we will invoke setClip() on the ImageModel to set the clipping region to that of JViewport. |
Dimension |
getPreferredScrollableViewportSize()
Implements Scrollable |
Dimension |
getPreferredSize()
Returns the pageSize of the current ImageModel, or the preferredSize of super() |
int |
getScrollableBlockIncrement(Rectangle visibleRect,
int orientation,
int direction)
Implements Scrollable |
boolean |
getScrollableTracksViewportHeight()
Implements Scrollable |
boolean |
getScrollableTracksViewportWidth()
Implements Scrollable |
int |
getScrollableUnitIncrement(Rectangle visibleRect,
int orientation,
int direction)
Implements Scrollable |
void |
paintBehindImage(Graphics g)
|
void |
paintComponent(Graphics g)
Paints the current Image of the ImageModel. |
void |
paintOverImage(Graphics g)
|
void |
setAllowSubClipping(boolean b)
Programmatically enables / disables subclipping. |
void |
setModel(ImageModel model)
Set the Model this canvas is responsible for rendering. |
void |
stateChanged(ChangeEvent ce)
Implements ChangeListener |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected ImageModel model
Constructor Detail |
---|
public ImageCanvas()
Method Detail |
---|
public void setModel(ImageModel model)
model
- The ImageModel to render.protected boolean allowClippedMode()
public void setAllowSubClipping(boolean b)
public Dimension getPreferredScrollableViewportSize()
getPreferredScrollableViewportSize
in interface Scrollable
public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction)
getScrollableBlockIncrement
in interface Scrollable
public boolean getScrollableTracksViewportHeight()
getScrollableTracksViewportHeight
in interface Scrollable
public boolean getScrollableTracksViewportWidth()
getScrollableTracksViewportWidth
in interface Scrollable
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction)
getScrollableUnitIncrement
in interface Scrollable
public void stateChanged(ChangeEvent ce)
stateChanged
in interface ChangeListener
public Dimension getPreferredSize()
getPreferredSize
in class JComponent
public void paintBehindImage(Graphics g)
public void paintOverImage(Graphics g)
public void paintComponent(Graphics g)
paintComponent
in class JComponent
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |