|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.diamondspin.DSView
public class DSView
DSView is an class the different views must customize. By default this one is an empty view. It's in this object you have
to implement a data structure to store the DSElement (a list or a tree, for instance). If you want to have a different
background for multiple views, you can store them here, but you will have to call the setBackground(...) of DSTabletopPane
to show them.
Copyright 2002-2009 DiamondSpin project. All Rights Reserved. Permission to use, copy, modify and distribute this software and its documentation for educational, research and non-profit purposes, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and the following three paragraphs appear in all copies. To request Permission to incorporate this software into commercial products contact one of the authors of the project.
IN NO EVENT SHALL THE AUTHORS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE AUTHORS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. THE AUTHORS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE AUTHORS HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
Field Summary | |
---|---|
protected double |
backgroundAngle
|
protected Point2D.Double |
backgroundCenter
|
protected BufferedImage |
backgroundImage
|
protected int |
backgroundMarginX
|
protected int |
backgroundMarginY
|
protected Paint |
backgroundPaint
|
protected double |
backgroundZoom
|
protected DSTabletopPane |
dsTabletopPane
|
static double |
FOLDED_HEIGHT_PERCENTAGE
|
static double |
FOLDED_WIDTH_PERCENTAGE
|
protected double |
foldedHeightPercentage
|
protected double |
foldedWidthPercentage
|
protected double |
oldBackgroundAngle
|
protected Point2D.Double |
oldBackgroundCenter
|
protected double |
oldBackgroundZoom
|
protected BufferedImage |
resizedBackground
|
protected EventListenerList |
viewListeners
|
Constructor Summary | |
---|---|
DSView(DSTabletopPane dsTabletopPane_Arg)
Constructor |
Method Summary | |
---|---|
void |
addDSGestureListener(DSGestureListener listener)
|
void |
addDSViewListener(DSViewListener listener)
|
void |
fireBackgroundRotated()
|
void |
fireBackgroundTranslated()
|
void |
fireBackgroundUpdated()
|
void |
fireBackgroundZoomed()
|
void |
fireGestureProgress(DSGestureEvent evt)
|
void |
fireGestureStart(DSGestureEvent evt)
|
void |
fireGestureStop(DSGestureEvent evt)
|
void |
fireViewGrabbed()
|
void |
fireViewReleased()
a view trigger events for global rotation |
void |
fireViewRotated()
a view trigger events for global rotation |
void |
fireViewTranslated()
|
void |
fireViewZoomed()
|
BufferedImage |
getBackground()
background cropped image for the view |
double |
getBackgroundAngle()
|
Point2D.Double |
getBackgroundCenter()
for the views which have a space bigger than the container it is possible to pan the |
Paint |
getBackgroundPaint()
Gets the backgroundPaint attribute of the DSView object |
double |
getBackgroundZoom()
zoom the background to set the given point in the center |
double |
getFoldedHeightPercentage()
|
double |
getFoldedWidthPercentage()
|
BufferedImage |
getFullBackground()
background image for the view |
DSTabletopPane |
getTabletopPane()
Gets the container attribute of the DSView object |
void |
incrBackgroundX(int incr)
scroll or pan or move (choose your word) the background |
void |
incrBackgroundY(int incr)
scroll or pan or move (choose your word) the background |
void |
mouseClicked(MouseEvent event)
mouse callbacks to receive events from the DSTabletopPane |
void |
mouseDragged(MouseEvent event)
mouse callbacks to receive events from the DSTabletopPane |
void |
mouseEntered(MouseEvent event)
mouse callbacks to receive events from the DSTabletopPane |
void |
mouseExited(MouseEvent event)
mouse callbacks to receive events from the DSTabletopPane |
void |
mouseMoved(MouseEvent event)
mouse callbacks to receive events from the DSTabletopPane |
void |
mousePressed(MouseEvent event)
mouse callbacks to receive events from the DSTabletopPane |
void |
mouseReleased(MouseEvent event)
mouse callbacks to receive events from the DSTabletopPane |
void |
openPopupMenuGlobal(double d,
double alpha,
int id)
open a popup menu related generally to the view, not one particular element |
void |
paint(Graphics2D g)
all the views can be painted |
void |
removeDSGestureListener(DSGestureListener l)
|
void |
removeViewListener(DSViewListener listener)
|
void |
setBackground(BufferedImage img)
a view has a nice image in background |
void |
setBackgroundAngle(double a)
rotate the background to reach the given angle |
void |
setBackgroundCenter(double x,
double y)
scroll or pan or move (choose your word) the background to set the given point in the center |
void |
setBackgroundPaint(Paint paint)
Sets the backgroundPaint attribute of the DSView object |
void |
setBackgroundZoom(double z)
zoom the background to set the given point in the center |
void |
setFoldedHeightPercentage(double foldedHeightPercentage)
|
void |
setFoldedWidthPercentage(double foldedWidthPercentage)
|
void |
setSnapToAngle(boolean shouldSnap)
if this is set to true, then all objects in the view will snap to a certain angle |
void |
updateBackground()
As displayed background may be rotated / translated /zoomed compred to the backgroundImage we have to update it often |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected DSTabletopPane dsTabletopPane
protected EventListenerList viewListeners
public static final double FOLDED_WIDTH_PERCENTAGE
public static final double FOLDED_HEIGHT_PERCENTAGE
protected double foldedWidthPercentage
protected double foldedHeightPercentage
protected BufferedImage backgroundImage
protected BufferedImage resizedBackground
protected Paint backgroundPaint
protected Point2D.Double backgroundCenter
protected int backgroundMarginX
protected int backgroundMarginY
protected double backgroundZoom
protected double backgroundAngle
protected double oldBackgroundZoom
protected double oldBackgroundAngle
protected Point2D.Double oldBackgroundCenter
Constructor Detail |
---|
public DSView(DSTabletopPane dsTabletopPane_Arg)
dsTabletopPane_Arg
- Description of the ParameterMethod Detail |
---|
public void addDSViewListener(DSViewListener listener)
public void removeViewListener(DSViewListener listener)
public void addDSGestureListener(DSGestureListener listener)
public void removeDSGestureListener(DSGestureListener l)
public void fireGestureStart(DSGestureEvent evt)
public void fireGestureProgress(DSGestureEvent evt)
public void fireGestureStop(DSGestureEvent evt)
public void fireViewRotated()
public void fireViewReleased()
public void fireViewTranslated()
public void fireBackgroundTranslated()
public void fireBackgroundRotated()
public void fireBackgroundZoomed()
public void fireBackgroundUpdated()
public void fireViewZoomed()
public void fireViewGrabbed()
public DSTabletopPane getTabletopPane()
public void paint(Graphics2D g)
g
- Description of the Parameterpublic void openPopupMenuGlobal(double d, double alpha, int id)
d
- the D where the popup should appearalpha
- the Alpha where the popup should appearid
- the user who invoked the popup menupublic void setBackground(BufferedImage img)
img
- The new background valuepublic void updateBackground()
public BufferedImage getBackground()
public BufferedImage getFullBackground()
public Point2D.Double getBackgroundCenter()
public void setBackgroundCenter(double x, double y)
x
- The new background Center in the viewy
- The new background Center in the viewpublic double getBackgroundAngle()
public void setBackgroundAngle(double a)
a
- The new background anglepublic double getBackgroundZoom()
public void setBackgroundZoom(double z)
z
- The new zoom factor in the viewpublic void incrBackgroundX(int incr)
incr
- Description of the Parameterpublic void incrBackgroundY(int incr)
incr
- Description of the Parameterpublic void mousePressed(MouseEvent event)
mousePressed
in interface MouseListener
event
- Description of the Parameterpublic void mouseReleased(MouseEvent event)
mouseReleased
in interface MouseListener
event
- Description of the Parameterpublic void mouseEntered(MouseEvent event)
mouseEntered
in interface MouseListener
event
- Description of the Parameterpublic void mouseExited(MouseEvent event)
mouseExited
in interface MouseListener
event
- Description of the Parameterpublic void mouseClicked(MouseEvent event)
mouseClicked
in interface MouseListener
event
- Description of the Parameterpublic void mouseMoved(MouseEvent event)
mouseMoved
in interface MouseMotionListener
event
- Description of the Parameterpublic void mouseDragged(MouseEvent event)
mouseDragged
in interface MouseMotionListener
event
- Description of the Parameterpublic Paint getBackgroundPaint()
public void setBackgroundPaint(Paint paint)
paint
- The new backgroundPaint valuepublic void setSnapToAngle(boolean shouldSnap)
shouldSnap
- The new snapToAngle valuepublic double getFoldedWidthPercentage()
public void setFoldedWidthPercentage(double foldedWidthPercentage)
public double getFoldedHeightPercentage()
public void setFoldedHeightPercentage(double foldedHeightPercentage)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |