|
||||||||||
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.JInternalFrame org.diamondspin.DSFrame org.diamondspin.DSImage
public class DSImage
DSImage is a default implementation of a DSElement handling images.
Copyright 2002-2006 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. |
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.diamondspin.DSFrame |
---|
DSFrame.DSInternalFrameTitlePane, DSFrame.DSMenuBarProxy, DSFrame.FingerRotationMode, DSFrame.FingerRotationSpeed |
Nested classes/interfaces inherited from class javax.swing.JInternalFrame |
---|
JInternalFrame.AccessibleJInternalFrame, JInternalFrame.JDesktopIcon |
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 boolean |
bw
|
protected double |
delta
|
protected double |
distToScaleOne
|
protected Point2D.Double[] |
fingers
|
protected Point2D.Double[] |
fingersglob
|
protected int |
firstFinger
|
protected String |
Footer
|
protected static BufferedImage |
FullSizeImage
|
protected static String |
FullSizeImageName
|
protected static boolean |
globalUseCache
|
protected String |
Header
|
protected BufferedImage |
image1
|
protected int |
imageID
|
protected String |
ImageName
|
protected float |
imageTransparency
|
protected double |
initBeta
|
protected boolean |
labeled
|
static int |
MAX_SCALE
|
static int |
MAXIMUM_SIDE_THN
|
static int |
MAXIMUM_SIDE_THNTHN
|
protected double |
MaxScale
|
static int |
ORIGINAL
|
protected int |
saveMode
|
Fields inherited from class javax.swing.JInternalFrame |
---|
closable, CONTENT_PANE_PROPERTY, desktopIcon, FRAME_ICON_PROPERTY, frameIcon, GLASS_PANE_PROPERTY, iconable, IS_CLOSED_PROPERTY, IS_ICON_PROPERTY, IS_MAXIMUM_PROPERTY, IS_SELECTED_PROPERTY, isClosed, isIcon, isMaximum, isSelected, LAYERED_PANE_PROPERTY, maximizable, MENU_BAR_PROPERTY, resizable, ROOT_PANE_PROPERTY, rootPane, rootPaneCheckingEnabled, title, TITLE_PROPERTY |
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 org.diamondspin.DSElement |
---|
HIGH_QUALITY, LOW_QUALITY |
Fields inherited from interface javax.swing.WindowConstants |
---|
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
DSImage(DSTabletopPane dsTabletopPane,
String imgfileName,
double d,
double alpha,
double scale)
Constructor with MaximumSide by default |
|
DSImage(DSTabletopPane dsTabletopPane,
String imgfileName,
double d,
double alpha,
double scale,
int maxSide)
Constructor |
|
DSImage(DSTabletopPane tabletopPane,
String filename,
double d,
double alpha,
double scale,
int maxSide,
boolean useCache)
Constructor |
Method Summary | |
---|---|
boolean |
contains(int x,
int y)
|
String |
getFooter()
Gets the footer attribute of the DSImage object |
String |
getHeader()
Gets the header attribute of the DSImage object |
BufferedImage |
getImage()
Accesor to the image to paint |
String |
getImageName()
Gets the imageName attribute of the DSImage object |
boolean |
isBw()
|
boolean |
isLabeled()
have to display text arround ? |
static boolean |
isUseCache()
Gets the useCache attribute of the DSImage class |
void |
reloadImage()
Reload the image because at the current scale factor we can have better resolution than the one given by the old loaded image. |
void |
scaleToHeight(int MaximumHeight_Arg)
scale the image so the height side has this size |
void |
scaleToMaximum(int MaximumSide_Arg)
scale the image so the longer side has this size |
void |
setBw(boolean bw)
|
void |
setFooter(String text)
Sets the footer attribute of the DSImage object |
void |
setHeader(String text)
Sets the header attribute of the DSImage object |
void |
setImage(BufferedImage img)
Accesor to the image to paint |
protected void |
setImageName(String ImageName_Arg)
Sets the imageName attribute of the DSImage object |
void |
setLabeled(boolean Labeled)
have to display text arround ? |
static void |
setUseCache(boolean UseCache_Arg)
Sets the useCache attribute of the DSImage class |
String |
toString()
|
void |
transformImage(BufferedImageOp op)
Reload the image because at the current scale factor we can have better resolution than the one given by the old loaded image. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.awt.event.MouseMotionListener |
---|
mouseDragged, mouseMoved |
Methods inherited from interface java.awt.event.MouseListener |
---|
mouseClicked, mouseEntered, mouseExited, mousePressed, mouseReleased |
Methods inherited from interface org.diamondspin.DSElement |
---|
acceptSlavery, acceptSlaveryRelease, addDSElementListener, doesContain, getAbsoluteScale, getAlpha, getBeta, getD, getHeight, getIDOwner, getScale, getTransform, getWidth, grabElement, isActive, isBetaAbs, isMouseTarget, isVisible, mouseClicked, mouseDragged, mouseMoved, mousePressed, mouseReleased, moveElementCenterTo, paint, paint, removeDSElementListener, setActive, setAlpha, setBeta, setBetaAbs, setD, setIDOwner, setScale, setSize, setVisible |
Field Detail |
---|
public static final int MAX_SCALE
public static int MAXIMUM_SIDE_THN
public static final int MAXIMUM_SIDE_THNTHN
public static final int ORIGINAL
protected int imageID
protected float imageTransparency
protected boolean bw
protected static BufferedImage FullSizeImage
protected static String FullSizeImageName
protected BufferedImage image1
protected boolean labeled
protected String Header
protected String Footer
protected String ImageName
protected double MaxScale
protected static boolean globalUseCache
protected Point2D.Double[] fingers
protected double distToScaleOne
protected double delta
protected Point2D.Double[] fingersglob
protected double initBeta
protected int saveMode
protected int firstFinger
Constructor Detail |
---|
public DSImage(DSTabletopPane dsTabletopPane, String imgfileName, double d, double alpha, double scale) throws MalformedURLException, IOException, Exception
imgfileName
- The name of the file to load the imagedsTabletopPane
- The dscontainer to display med
- diatance to the centeralpha
- angle from the rightscale
- scale factor of the imageif the image cannot be loaded
MalformedURLException
IOException
Exception
public DSImage(DSTabletopPane dsTabletopPane, String imgfileName, double d, double alpha, double scale, int maxSide) throws MalformedURLException, IOException, Exception
dsTabletopPane
- The unique DSTabletopPane which display everythingimgfileName
- The name of the file to load the imaged
- The distance to the center where to put the new elementalpha
- The angle around the center where to put the new elementscale
- The scale factor to zoom the elenemt=maxSide
- The maximun size of the longest side // useCache is set to the default, which is UseCache
Exception
- Description of the Exception
MalformedURLException
IOException
public DSImage(DSTabletopPane tabletopPane, String filename, double d, double alpha, double scale, int maxSide, boolean useCache) throws MalformedURLException, IOException, Exception
tabletopPane
- The unique DSTabletopPane which display everythingfilename
- The document named
- The distance to the center where to put the new elementalpha
- The angle around the center where to put the new elementscale
- The scale factor to zoom the elenemt=maxSide
- The maximun size of the longest sideuseCache
- This is used to set caching to a non default value
Exception
- Description of the Exception
MalformedURLException
IOException
Method Detail |
---|
public void scaleToMaximum(int MaximumSide_Arg)
MaximumSide_Arg
- Description of the Parameterpublic void scaleToHeight(int MaximumHeight_Arg)
MaximumHeight_Arg
- Description of the Parameterpublic boolean contains(int x, int y)
contains
in class DSFrame
x
- y
-
public void transformImage(BufferedImageOp op)
public void reloadImage()
public BufferedImage getImage()
public void setImage(BufferedImage img)
public void setLabeled(boolean Labeled)
Labeled
- The new labeled valuepublic boolean isLabeled()
public void setHeader(String text)
text
- The new header valuepublic String getHeader()
public void setFooter(String text)
text
- The new footer valuepublic String getFooter()
public String getImageName()
protected void setImageName(String ImageName_Arg)
ImageName_Arg
- The new imageName valuepublic static void setUseCache(boolean UseCache_Arg)
UseCache_Arg
- The new useCache valuepublic static boolean isUseCache()
public String toString()
DSFrame
toString
in class DSFrame
public boolean isBw()
public void setBw(boolean bw)
bw
- the bw to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |