Activates the HUD; since a HUD cannot be invisible and active, it is implicitly made
visible at the same time; active HUDs receive input events, e.g mouse movement
and keyboard presses.
In this example program, simply adds some hard-coded HUDs;
a typical editor would load classes from some form of config
file or etc to dynamically include additional features.
Converts all added shapes to Area instances if they are not already, since Sun's 2D
API was badly designed and prevents you from applying AffineTransforms to most
shapes.
Only returns HUDs that are both active and visible (assumes that invisible HUDs, which
cannot give feedback on what the user is doing, should not be counted active - but leaves
them "isActive() == true" so that as soon as they are made visible again they will
automatically become active)
The Document is a simple MVC Model containing data on what shapes there are,
where they are, etc; it has all the data that would be "saved" if there were a load/save
feature in this demo!
Sun's Swing API does automatic dynamic sized layout - it needs this method to tell it
how much space to allocate to this particular GUI element (the HUDList)
Useful control that allows the user to hide/show any layer and also to activate / de-activate
any layer; also displays name and status of all layers, and shows their paint order
A very simple main renderer that simply grabs a paint surface on every repaint (managed
by Sun's windowing system, "Swing") and gets each visible HUD to paint to that
surface in turn.
A simple HUD that, when active, draws a crosshair and responds to drag / click+move events
by drawing a new Rectangle, and when the mouse is released it creates a new rectangle
of that size + position and adds it to the base document
Simple HUD which displays a "your mouse cursor is currently floating over THIS shape"
selection-box style thing, and includes a tool which will allow you to drag shapes around
the document, even multiple shapes at once (if they overlap and can be dragged in a
single gesture).
The Document is a simple MVC Model containing data on what shapes there are,
where they are, etc; it has all the data that would be "saved" if there were a load/save
feature in this demo!
Enables a HUD to temporarily mask out all currently active HUD's in favour of one
in particular; once that HUD has completed it's action, it should call exitExclusiveHUD
to re-enable all previously active HUDs.
Sets cursor position ignoring any special transformations performed on
the rendering surface (this method then automatically applies those
transformations to the incoming co-ords before storing them)
shapes -
Variable in class net.tmachine.gpg.hue.Document