multivalent.gui
Class VFrame
public
class
VFrame
extends INode
implements EventListener
Movable, resizable internal window, with title bar.
Lens subclasses to add composition of effects via a LensMan(ager).
The class Note subclasses to add a Document instance.
Dialog subclasses to add HTML form.
Version: $Revision: 1.4 $ $Date: 2002/05/28 19:50:20 $
See Also: Lens
Field Summary |
static int | HEIGHT_MIN Minimum dimension for window. |
boolean | lampshade Show just title bar or full window. |
static String | MSG_CLOSED
Announce that Frame has been closed.
|
static String | MSG_MOVED
Announce that Frame has been moved.
|
static String | MSG_RAISED
Announce that Frame has raised above all other Frames.
|
static String | MSG_RESIZED
Announce that Frame has changed size.
|
static String | PREF_VANISHING
Remove window controls when cursor not in frame?
|
boolean | resizable Refers to interactive resizing with mouse, not programmatic control. |
static int | WIDTH_MIN Minimum dimension for window. |
Constructor Summary |
| VFrame(String name, Map<String,Object> attr, INode parent) |
| VFrame(String name, Map<String,Object> attr, INode parent, URI docuri) Content given by passed URL; pass null if want to build subtree yourself. |
Method Summary |
void | close() Remove window from screen. |
void | event(AWTEvent e) Handle events while moving, resizing, .... |
boolean | eventBeforeAfter(AWTEvent e, Point rel) |
boolean | eventNode(AWTEvent e, Point rel) |
boolean | formatNode(int width, int height, Context cx) |
Rectangle | getContentBounds() Returns new Rectangle sized and positioned to cover content, not title bar. |
String | getTitle() Bounds of window, with (x,y) relative to containing Document.
|
boolean | isPinned() |
void | paintNode(Rectangle docclip, Context cx)
Draw content, then window apparatus (title bar, resize nib).
|
void | raise() Windows added on top, so raise to top = remove + add. |
void | setBounds(int x, int y, int width, int height) Identical to setLocation(x,y), setSize(width,height); |
void | setIn(boolean in) |
void | setLocation(int x, int y)
Should be fast so can interactively move window --
in the past have minimized amount of redrawing, but at 500MHz Pentium and HotSpot, plenty fast enough to redraw entire document. |
void | setPinned(boolean pinned)
Moves between RELATIVE and ABSOLUTE visual layers on class Document,
translating coordinates so window appears at same location at present scroll. |
void | setSize(int width, int height)
Set dimensions of window, including title bar.
|
void | setTitle(String title) |
public static final int HEIGHT_MIN
Minimum dimension for window.
public boolean lampshade
Show just title bar or full window. Different than iconify.
public static final String MSG_CLOSED
Announce that Frame has been closed.
"frameResized": arg= VFrame instance.
public static final String MSG_MOVED
Announce that Frame has been moved.
"frameMoved": arg= VFrame instance.
public static final String MSG_RAISED
Announce that Frame has raised above all other Frames.
"frameRaised": arg= VFrame instance.
public static final String MSG_RESIZED
Announce that Frame has changed size.
"frameResized": arg= VFrame instance.
public static final String PREF_VANISHING
Remove window controls when cursor not in frame?
Boolean "vanishingTitle"
public boolean resizable
Refers to interactive resizing with mouse, not programmatic control.
public static final int WIDTH_MIN
Minimum dimension for window.
public VFrame(String name, Map<String,Object> attr,
INode parent)
public VFrame(String name, Map<String,Object> attr,
INode parent, URI docuri)
Content given by passed URL; pass null if want to build subtree yourself.
public void close()
Remove window from screen.
public void event(AWTEvent e)
Handle events while moving, resizing, ....
public boolean eventBeforeAfter(AWTEvent e, Point rel)
public boolean eventNode(AWTEvent e, Point rel)
public boolean formatNode(int width, int height,
Context cx)
public Rectangle getContentBounds()
Returns new Rectangle sized and positioned to cover content, not title bar.
public String getTitle()
Bounds of window, with (x,y) relative to containing Document.
public Rectangle getBounds() {
Rectangle r = super.getBounds();
if (lampshade) r.setSize(r.width,titleh+1);
//if (doc!=null) System.out.println("doc="+doc_+", x="+doc_.getHsb().getValue()+", y="+doc_.getVsb().getValue());
//System.out.print(r+" => ");
Document doc=getDocument();
if (!pinned_) r.translate(-doc.getHsb().getValue(), -doc.getVsb().getValue());
//System.out.println(" => "+r);
// if (pir!=null) r.translate(-pir.x,-pir.y);
return r;
}
public Rectangle getContentBounds() {
Point p = getRelLocation(getDocument());
return new Rectangle(p.x,p.y, bbox.width,bbox.height-titleh);
}
public boolean isPinned()
public void paintNode(Rectangle docclip,
Context cx)
Draw content, then window apparatus (title bar, resize nib).
LATER: take colors for window apparatus from style sheet.
public void raise()
Windows added on top, so raise to top = remove + add.
public void setBounds(int x, int y, int width, int height)
Identical to setLocation(x,y), setSize(width,height);
public void setIn(boolean in)
public void setLocation(int x, int y)
Should be fast so can interactively move window --
in the past have minimized amount of redrawing, but at 500MHz Pentium and HotSpot, plenty fast enough to redraw entire document.
public void setPinned(boolean pinned)
Moves between RELATIVE and ABSOLUTE visual layers on class Document,
translating coordinates so window appears at same location at present scroll.
public void setSize(int width, int height)
Set dimensions of window, including title bar.
Should be fast so can interactively resize window.
Use this instead of setting bbox dimensions directly (should probably enforce all Node bbox manipulation with setSize/setLocation/setBounds).
public void setTitle(String title)