|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.mars_sim.msp.ui.swing.tool.settlement.SettlementMapPanel
public class SettlementMapPanel
A panel for displaying the settlement map.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
JPanel.AccessibleJPanel |
| 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 | |
|---|---|
static double |
DEFAULT_SCALE
|
static double |
MAX_SCALE
|
static double |
MIN_SCALE
|
| 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 java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
SettlementMapPanel()
A panel for displaying a settlement map. |
|
| Method Summary | |
|---|---|
void |
clockPulse(double time)
|
Point2D.Double |
convertToSettlementLocation(int xPixel,
int yPixel)
Convert a pixel X,Y position to a X,Y (meter) position local to the settlement in view. |
void |
destroy()
Cleans up the map panel for disposal. |
double |
getRotation()
Gets the map rotation. |
double |
getScale()
Gets the map scale. |
Person |
getSelectedPerson()
Get the selected person for the current settlement. |
Settlement |
getSettlement()
Gets the settlement currently displayed. |
boolean |
isShowBuildingLabels()
Checks if building labels should be displayed. |
boolean |
isShowConstructionLabels()
Checks if construction site labels should be displayed. |
boolean |
isShowPersonLabels()
Checks if person labels should be displayed. |
boolean |
isShowVehicleLabels()
Checks if vehicle labels should be displayed. |
void |
moveCenter(double xDiff,
double yDiff)
Moves the center of the map by a given number of pixels. |
protected void |
paintComponent(Graphics g)
|
void |
pauseChange(boolean isPaused)
|
void |
reCenter()
Resets the position, scale and rotation of the map. |
void |
selectPerson(Person person)
Selects a person on the map. |
void |
selectPersonAt(int xPixel,
int yPixel)
Selects a person if any person is at the given x and y pixel position. |
void |
setRotation(double rotation)
Sets the map rotation. |
void |
setScale(double scale)
Sets the map scale. |
void |
setSettlement(Settlement settlement)
Sets the settlement to display. |
void |
setShowBuildingLabels(boolean showLabels)
Sets if building labels should be displayed. |
void |
setShowConstructionLabels(boolean showLabels)
Sets if construction site labels should be displayed. |
void |
setShowPersonLabels(boolean showLabels)
Sets if person labels should be displayed. |
void |
setShowVehicleLabels(boolean showLabels)
Sets if vehicle labels should be displayed. |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final double DEFAULT_SCALE
public static final double MAX_SCALE
public static final double MIN_SCALE
| Constructor Detail |
|---|
public SettlementMapPanel()
| Method Detail |
|---|
public Settlement getSettlement()
public void setSettlement(Settlement settlement)
settlement - the settlement.public double getScale()
public void setScale(double scale)
scale - (pixels per meter).public double getRotation()
public void setRotation(double rotation)
rotation - (radians).public void reCenter()
public void moveCenter(double xDiff,
double yDiff)
xDiff - the X axis pixels.yDiff - the Y axis pixels.
public void selectPersonAt(int xPixel,
int yPixel)
xPixel - the x pixel position on the displayed map.yPixel - the y pixel position on the displayed map.public void selectPerson(Person person)
person - the selected person.public Person getSelectedPerson()
public Point2D.Double convertToSettlementLocation(int xPixel,
int yPixel)
xPixel - the pixel X position.yPixel - the pixel Y position.
public boolean isShowBuildingLabels()
public void setShowBuildingLabels(boolean showLabels)
showLabels - true if building labels should be displayed.public boolean isShowConstructionLabels()
public void setShowConstructionLabels(boolean showLabels)
showLabels - true if construction site labels should be displayed.public boolean isShowPersonLabels()
public void setShowPersonLabels(boolean showLabels)
showLabels - true if person labels should be displayed.public boolean isShowVehicleLabels()
public void setShowVehicleLabels(boolean showLabels)
showLabels - true if vehicle labels should be displayed.protected void paintComponent(Graphics g)
paintComponent in class JComponentpublic void destroy()
public void clockPulse(double time)
clockPulse in interface ClockListenerpublic void pauseChange(boolean isPaused)
pauseChange in interface ClockListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||