Current Page:
NeXtMidas Training
Macros - Part 2 (Graphics)
Lab 13
Instructions
|
- Start Here
+ Background
+ Common Midas Concepts
+ Getting Started
+ Working with Files
+ Option Trees
+ Macros - Part 1 (Basics)
- Macros - Part 2 (Graphics)
+ Intro to Graphics
+ GControls
+ Lab 11
+ Plotting and Listing
+ Panel Setup
+ Lab 12
+ Conclusion
- Lab 13
- Instructions
- Solution
+ Primitives
+ Installing NeXtMidas
+ Applets & WebStart
- Mapping (NeXtEarth)
+ Remote Midas InterFace (RMIF)
+ Using NetBeans
+ X-Midas Interoperability
+ Remoting an X-Midas App.
|
- Lab 13:
- For this lab you will work with plots, lists, features, controls and panels. It will
be a lot of fun (actual amount fun not guaranteed).
- For this lab you will provide the user with a plot of the world. When the user clicks
on the plot you will need to mark the location with a feature (only the last click
should be marked). When the user clicks you will also need to put the coordinates into
a set of controls that will show the coordinates in decimal-place notation. To keep
a history of the clicks you will need a list to keep track of all past clicks, listing
them with a one-up identifier ("Point Number 1", "Point Number 2", ...) and giving
their position in Deg-Min-Sec notation (use "ft" for Altitude to the nearest foot).
- When you are done it will look a bit like this:
|
Click image for larger view.
|
- The main things you need to do are, though not necessarially in this order:
- Panel
- Create a panel and configure it similar to the picture.
- Plot
- Plot the world shape file with the cities overlaid.
- Plot should send its messages to the macro.
- List
- Create a file to initialize list with.
- Create a template for the list that will format the columns correctly and will
color the fields red.
- Controls
- Create an "Exit" button in a label that can not be closed.
- Create the controls to hold the position of the last ckick, be sure to make them
not-editable.
- Add the "Map Options" and "City Color" controls to a "Plot Options" label that
is closed by default.
- The "Map Options" control should allow the user to make the map "Transparent" or
"Opaque".
- The "City Color" control should have a "SetColor" button that when clicked brings
up a popup color chooser. (Note: The popup should be non blocking - see the
POPUP explain file for details.)
- Messages
- You will need to process the messages from the plot and from the controls.
- When you get a new color for the cities (from the popup) you will need to change
the color of the "cities" layer in the plot.
|