267 lines
9.1 KiB
HTML
267 lines
9.1 KiB
HTML
|
<!--NewPage-->
|
||
|
<html>
|
||
|
<head>
|
||
|
<!-- Generated by javadoc on Sat May 10 12:20:47 1997 -->
|
||
|
<a name="_top_"></a>
|
||
|
<title>
|
||
|
Class ClickableLabel
|
||
|
</title>
|
||
|
</head>
|
||
|
<body>
|
||
|
<h1>
|
||
|
Class ClickableLabel
|
||
|
</h1>
|
||
|
<pre>
|
||
|
<a href="java.lang.Object.html#_top_">java.lang.Object</a>
|
||
|
|
|
||
|
+----<a href="java.awt.Component.html#_top_">java.awt.Component</a>
|
||
|
|
|
||
|
+----<a href="java.awt.Canvas.html#_top_">java.awt.Canvas</a>
|
||
|
|
|
||
|
+----ClickableLabel
|
||
|
</pre>
|
||
|
<hr>
|
||
|
<dl>
|
||
|
<dt> class <b>ClickableLabel</b>
|
||
|
<dt> extends <a href="java.awt.Canvas.html#_top_">Canvas</a>
|
||
|
</dl>
|
||
|
This class extends <tt>Canvas</tt> and is used to create a custom
|
||
|
component that will detect control mouse clicks on a label. It
|
||
|
simply places a label on a canvas and overrides the necessary
|
||
|
methods. When a <tt>MOUSE_DOWN</tt> event occurs on the label,
|
||
|
a new event is created and delivered.
|
||
|
<dl>
|
||
|
<dt> <b>See Also:</b>
|
||
|
<dd> <a href="ControlClickEvent.html#_top_">ControlClickEvent</a>
|
||
|
</dl>
|
||
|
<hr>
|
||
|
<a name="index"></a>
|
||
|
<h2>
|
||
|
<img src="images/constructor-index.gif" width=275 height=38 alt="Constructor Index">
|
||
|
</h2>
|
||
|
<dl>
|
||
|
<dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
|
||
|
<a href="#ClickableLabel(java.lang.String)"><b>ClickableLabel</b></a>(String)
|
||
|
<dd> Most classes will use this constructor method.
|
||
|
<dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
|
||
|
<a href="#ClickableLabel(java.lang.String, boolean)"><b>ClickableLabel</b></a>(String, boolean)
|
||
|
<dd> This constructor method is only used by <tt>ClickableLabels</tt>
|
||
|
placed in the <tt>BreedFrame</tt>.
|
||
|
</dl>
|
||
|
<h2>
|
||
|
<img src="images/method-index.gif" width=207 height=38 alt="Method Index">
|
||
|
</h2>
|
||
|
<dl>
|
||
|
<dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
|
||
|
<a href="#getLabel()"><b>getLabel</b></a>()
|
||
|
<dd> Accessor method for the label.
|
||
|
<dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
|
||
|
<a href="#minimumSize()"><b>minimumSize</b></a>()
|
||
|
<dd> Defines the minimum size to be the same the preferred size
|
||
|
|
||
|
|
||
|
<dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
|
||
|
<a href="#mouseDown(java.awt.Event, int, int)"><b>mouseDown</b></a>(Event, int, int)
|
||
|
<dd> Detect <tt>MOUSE_DOWN</tt> events and create a new <tt>CTRL_CLICK</tt>
|
||
|
event defined in the <tt>ControlClickEvent</tt> class.
|
||
|
<dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
|
||
|
<a href="#paint(java.awt.Graphics)"><b>paint</b></a>(Graphics)
|
||
|
<dd> Draw the label on the canvas.
|
||
|
<dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
|
||
|
<a href="#paramString()"><b>paramString</b></a>()
|
||
|
<dd> Create the event argument
|
||
|
|
||
|
<dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
|
||
|
<a href="#preferredSize()"><b>preferredSize</b></a>()
|
||
|
<dd> Calculate the preferred size based on the current font settings
|
||
|
|
||
|
|
||
|
<dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
|
||
|
<a href="#reshape(int, int, int, int)"><b>reshape</b></a>(int, int, int, int)
|
||
|
<dd> Reshape the label
|
||
|
|
||
|
|
||
|
<dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
|
||
|
<a href="#resize(int, int)"><b>resize</b></a>(int, int)
|
||
|
<dd> Specify a new width and height for the label
|
||
|
|
||
|
|
||
|
<dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
|
||
|
<a href="#setInsets(java.awt.Insets)"><b>setInsets</b></a>(Insets)
|
||
|
<dd> Change the insets
|
||
|
|
||
|
|
||
|
</dl>
|
||
|
<a name="constructors"></a>
|
||
|
<h2>
|
||
|
<img src="images/constructors.gif" width=231 height=38 alt="Constructors">
|
||
|
</h2>
|
||
|
<a name="ClickableLabel"></a>
|
||
|
<a name="ClickableLabel(java.lang.String)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
|
||
|
<b>ClickableLabel</b>
|
||
|
<pre>
|
||
|
public ClickableLabel(<a href="java.lang.String.html#_top_">String</a> label)
|
||
|
</pre>
|
||
|
<dl>
|
||
|
<dd> Most classes will use this constructor method. It simply
|
||
|
assigns the string label.
|
||
|
<dl>
|
||
|
<dt> <b>Parameters:</b>
|
||
|
<dd> label - the string label
|
||
|
</dl>
|
||
|
</dl>
|
||
|
<a name="ClickableLabel(java.lang.String, boolean)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
|
||
|
<b>ClickableLabel</b>
|
||
|
<pre>
|
||
|
public ClickableLabel(<a href="java.lang.String.html#_top_">String</a> label,
|
||
|
boolean es)
|
||
|
</pre>
|
||
|
<dl>
|
||
|
<dd> This constructor method is only used by <tt>ClickableLabels</tt>
|
||
|
placed in the <tt>BreedFrame</tt>.
|
||
|
<dl>
|
||
|
<dt> <b>Parameters:</b>
|
||
|
<dd> label - the string label
|
||
|
<dd> es - specifies that we want extra space around the label
|
||
|
</dl>
|
||
|
</dl>
|
||
|
<a name="methods"></a>
|
||
|
<h2>
|
||
|
<img src="images/methods.gif" width=151 height=38 alt="Methods">
|
||
|
</h2>
|
||
|
<a name="paint(java.awt.Graphics)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
|
||
|
<a name="paint"><b>paint</b></a>
|
||
|
<pre>
|
||
|
public void paint(<a href="java.awt.Graphics.html#_top_">Graphics</a> g)
|
||
|
</pre>
|
||
|
<dl>
|
||
|
<dd> Draw the label on the canvas.
|
||
|
<dl>
|
||
|
<dt> <b>Parameters:</b>
|
||
|
<dd> g - the Graphics objbect
|
||
|
<dt> <b>Overrides:</b>
|
||
|
<dd> <a href="java.awt.Canvas.html#paint(java.awt.Graphics)">paint</a> in class <a href="java.awt.Canvas.html#_top_">Canvas</a>
|
||
|
</dl>
|
||
|
</dl>
|
||
|
<a name="setInsets(java.awt.Insets)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
|
||
|
<a name="setInsets"><b>setInsets</b></a>
|
||
|
<pre>
|
||
|
public void setInsets(<a href="java.awt.Insets.html#_top_">Insets</a> insets)
|
||
|
</pre>
|
||
|
<dl>
|
||
|
<dd> Change the insets
|
||
|
<dl>
|
||
|
<dt> <b>Parameters:</b>
|
||
|
<dd> insets - the new inset values
|
||
|
</dl>
|
||
|
</dl>
|
||
|
<a name="getLabel()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
|
||
|
<a name="getLabel"><b>getLabel</b></a>
|
||
|
<pre>
|
||
|
public <a href="java.lang.String.html#_top_">String</a> getLabel()
|
||
|
</pre>
|
||
|
<dl>
|
||
|
<dd> Accessor method for the label.
|
||
|
<dl>
|
||
|
<dt> <b>Returns:</b>
|
||
|
<dd> the label
|
||
|
</dl>
|
||
|
</dl>
|
||
|
<a name="resize(int, int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
|
||
|
<a name="resize"><b>resize</b></a>
|
||
|
<pre>
|
||
|
public void resize(int w,
|
||
|
int h)
|
||
|
</pre>
|
||
|
<dl>
|
||
|
<dd> Specify a new width and height for the label
|
||
|
<dl>
|
||
|
<dt> <b>Parameters:</b>
|
||
|
<dd> w - the width
|
||
|
<dd> h - the height
|
||
|
<dt> <b>Overrides:</b>
|
||
|
<dd> <a href="java.awt.Component.html#resize(int, int)">resize</a> in class <a href="java.awt.Component.html#_top_">Component</a>
|
||
|
</dl>
|
||
|
</dl>
|
||
|
<a name="reshape(int, int, int, int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
|
||
|
<a name="reshape"><b>reshape</b></a>
|
||
|
<pre>
|
||
|
public void reshape(int x,
|
||
|
int y,
|
||
|
int w,
|
||
|
int h)
|
||
|
</pre>
|
||
|
<dl>
|
||
|
<dd> Reshape the label
|
||
|
<dl>
|
||
|
<dt> <b>Parameters:</b>
|
||
|
<dd> x - the x coordinate
|
||
|
<dd> y - the y coordinate
|
||
|
<dd> w - the width
|
||
|
<dd> h - the height
|
||
|
<dt> <b>Overrides:</b>
|
||
|
<dd> <a href="java.awt.Component.html#reshape(int, int, int, int)">reshape</a> in class <a href="java.awt.Component.html#_top_">Component</a>
|
||
|
</dl>
|
||
|
</dl>
|
||
|
<a name="minimumSize()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
|
||
|
<a name="minimumSize"><b>minimumSize</b></a>
|
||
|
<pre>
|
||
|
public <a href="java.awt.Dimension.html#_top_">Dimension</a> minimumSize()
|
||
|
</pre>
|
||
|
<dl>
|
||
|
<dd> Defines the minimum size to be the same the preferred size
|
||
|
<dl>
|
||
|
<dt> <b>Returns:</b>
|
||
|
<dd> the dimensions of the preferred size
|
||
|
<dt> <b>Overrides:</b>
|
||
|
<dd> <a href="java.awt.Component.html#minimumSize()">minimumSize</a> in class <a href="java.awt.Component.html#_top_">Component</a>
|
||
|
</dl>
|
||
|
</dl>
|
||
|
<a name="preferredSize()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
|
||
|
<a name="preferredSize"><b>preferredSize</b></a>
|
||
|
<pre>
|
||
|
public <a href="java.awt.Dimension.html#_top_">Dimension</a> preferredSize()
|
||
|
</pre>
|
||
|
<dl>
|
||
|
<dd> Calculate the preferred size based on the current font settings
|
||
|
<dl>
|
||
|
<dt> <b>Returns:</b>
|
||
|
<dd> the dimesions of the preferred size
|
||
|
<dt> <b>Overrides:</b>
|
||
|
<dd> <a href="java.awt.Component.html#preferredSize()">preferredSize</a> in class <a href="java.awt.Component.html#_top_">Component</a>
|
||
|
</dl>
|
||
|
</dl>
|
||
|
<a name="mouseDown(java.awt.Event, int, int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
|
||
|
<a name="mouseDown"><b>mouseDown</b></a>
|
||
|
<pre>
|
||
|
public boolean mouseDown(<a href="java.awt.Event.html#_top_">Event</a> event,
|
||
|
int x,
|
||
|
int y)
|
||
|
</pre>
|
||
|
<dl>
|
||
|
<dd> Detect <tt>MOUSE_DOWN</tt> events and create a new <tt>CTRL_CLICK</tt>
|
||
|
event defined in the <tt>ControlClickEvent</tt> class.
|
||
|
<dl>
|
||
|
<dt> <b>Parameters:</b>
|
||
|
<dd> event - the AWT generated event
|
||
|
<dd> x - the x coordinate of the mouse location
|
||
|
<dd> y - the y coordinate of the mouse location
|
||
|
<dt> <b>Overrides:</b>
|
||
|
<dd> <a href="java.awt.Component.html#mouseDown(java.awt.Event, int, int)">mouseDown</a> in class <a href="java.awt.Component.html#_top_">Component</a>
|
||
|
</dl>
|
||
|
</dl>
|
||
|
<a name="paramString()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
|
||
|
<a name="paramString"><b>paramString</b></a>
|
||
|
<pre>
|
||
|
protected <a href="java.lang.String.html#_top_">String</a> paramString()
|
||
|
</pre>
|
||
|
<dl>
|
||
|
<dd> Create the event argument
|
||
|
<dl>
|
||
|
<dt> <b>Overrides:</b>
|
||
|
<dd> <a href="java.awt.Component.html#paramString()">paramString</a> in class <a href="java.awt.Component.html#_top_">Component</a>
|
||
|
</dl>
|
||
|
</dl>
|
||
|
</body>
|
||
|
</html>
|