|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openstreetmap.josm.Main
public abstract class Main
Nested Class Summary | |
---|---|
private static class |
Main.DownloadParamType
The type of a command line parameter, to be used in switch statements. |
static interface |
Main.InitStatusListener
|
private static class |
Main.WindowPositionSizeListener
|
Field Summary | |
---|---|
static boolean |
applet
Set to true , when in applet mode |
protected static javax.swing.JPanel |
contentPanePrivate
|
static PleaseWaitProgressMonitor |
currentProgressMonitor
|
protected static WindowGeometry |
geometry
|
private GettingStarted |
gettingStarted
The MOTD Layer. |
private static Main.InitStatusListener |
initListener
|
static boolean |
isOpenjdk
Whether or not the java vm is openjdk We use this to work around openjdk bugs |
private static java.util.ArrayList<java.lang.ref.WeakReference<ProjectionChangeListener>> |
listeners
|
static int |
log_level
Logging level (3 = debug, 2 = info, 1 = warn, 0 = none). |
static Main |
main
Global application. |
static MapFrame |
map
The MapFrame. |
MainMenu |
menu
The main menu bar at top of screen. |
static javax.swing.JPanel |
panel
|
static java.awt.Component |
parent
Global parent component for all dialogs and message boxes |
static PrimitiveDeepCopy |
pasteBuffer
The global paste buffer. |
static Layer |
pasteSource
|
static PlatformHook |
platform
Platform specific code goes in here. |
static Preferences |
pref
Global application preferences |
private static Projection |
proj
The projection method used. |
private OsmDataLayer.CommandQueueListener |
redoUndoListener
|
static ToolbarPreferences |
toolbar
The toolbar preference control to register new actions. |
UndoRedoHandler |
undoRedo
|
OsmValidator |
validator
The data validation handler. |
protected static int |
windowState
|
static java.util.concurrent.ExecutorService |
worker
The worker thread slave. |
Constructor Summary | |
---|---|
Main()
|
Method Summary | |
---|---|
void |
addLayer(Layer layer)
Add a new layer to the map. |
static void |
addListener()
|
static void |
addProjectionChangeListener(ProjectionChangeListener listener)
Register a projection change listener |
static void |
checkJava6()
|
static void |
debug(java.lang.String msg)
Print an debug message if logging is on. |
static void |
debug(java.lang.String msg,
java.lang.Object... objects)
Print a formated debug message if logging is on. |
static void |
determinePlatformHook()
|
private static void |
downloadFromParamBounds(boolean rawGps,
Bounds b)
Download area specified as Bounds value. |
private static void |
downloadFromParamBounds(boolean rawGps,
java.lang.String s)
Download area specified on the command line as bounds string. |
private static void |
downloadFromParamHttp(boolean rawGps,
java.lang.String s)
Download area specified on the command line as OSM URL. |
static boolean |
exitJosm(boolean exit)
|
private static void |
fireProjectionChanged(Projection oldValue,
Projection newValue,
Bounds oldBounds)
|
Layer |
getActiveLayer()
Returns the currently active layer |
DataSet |
getCurrentDataSet()
Replies the current data set. |
OsmDataLayer |
getEditLayer()
Replies the current edit layer |
static Projection |
getProjection()
Replies the current projection. |
boolean |
hasEditLayer()
Replies true if there is an edit layer |
static void |
info(java.lang.String msg)
Print an informational message if logging is on. |
static void |
info(java.lang.String msg,
java.lang.Object... objects)
Print a formated informational message if logging is on. |
static boolean |
isDisplayingMapView()
Replies true if JOSM currently displays a map view. |
private Main.DownloadParamType |
paramType(java.lang.String s)
Guess the type of a parameter string specified on the command line with --download= or --downloadgps. |
void |
postConstructorProcessCmdLine(java.util.Map<MainApplication.Option,java.util.Collection<java.lang.String>> args)
|
static void |
preConstructorInit(java.util.Map<MainApplication.Option,java.util.Collection<java.lang.String>> args)
Should be called before the main constructor to setup some parameter stuff |
static void |
redirectToMainContentPane(javax.swing.JComponent source)
|
static void |
registerActionShortcut(javax.swing.Action action,
Shortcut shortcut)
|
static void |
registerActionShortcut(JosmAction action)
|
void |
removeLayer(Layer layer)
Remove the specified layer from the map. |
static void |
removeProjectionChangeListener(ProjectionChangeListener listener)
Removes a projection change listener |
static boolean |
saveUnsavedModifications()
|
static void |
setInitStatusListener(Main.InitStatusListener listener)
|
void |
setMapFrame(MapFrame map)
Set or clear (if passed null ) the map. |
static void |
setProjection(Projection p)
Sets the current projection |
static void |
unregisterActionShortcut(javax.swing.Action action,
Shortcut shortcut)
|
static void |
unregisterActionShortcut(JosmAction action)
|
static void |
unregisterShortcut(Shortcut shortcut)
|
static void |
warn(java.lang.String msg)
Print a warning message if logging is on. |
static void |
warn(java.lang.String msg,
java.lang.Object... objects)
Print a formated warning message if logging is on. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.awt.Component parent
public static Main main
public static final java.util.concurrent.ExecutorService worker
public static Preferences pref
public static final PrimitiveDeepCopy pasteBuffer
public static Layer pasteSource
public static MapFrame map
public static boolean applet
true
, when in applet mode
public static ToolbarPreferences toolbar
public UndoRedoHandler undoRedo
public static PleaseWaitProgressMonitor currentProgressMonitor
public MainMenu menu
public OsmValidator validator
private GettingStarted gettingStarted
public static int log_level
public static PlatformHook platform
public static boolean isOpenjdk
private static Main.InitStatusListener initListener
protected static final javax.swing.JPanel contentPanePrivate
public static final javax.swing.JPanel panel
protected static WindowGeometry geometry
protected static int windowState
private final OsmDataLayer.CommandQueueListener redoUndoListener
private static Projection proj
getProjection()
and setProjection(Projection)
for access.
Use setProjection(Projection)
in order to trigger a projection change event.
private static final java.util.ArrayList<java.lang.ref.WeakReference<ProjectionChangeListener>> listeners
Constructor Detail |
---|
public Main()
Method Detail |
---|
public static boolean isDisplayingMapView()
true
if JOSM currently displays a map viewpublic static void warn(java.lang.String msg)
msg
- The message to print.public static void info(java.lang.String msg)
msg
- The message to print.public static void debug(java.lang.String msg)
msg
- The message to print.public static void warn(java.lang.String msg, java.lang.Object... objects)
MessageFormat.format(java.lang.Object[], java.lang.StringBuffer, java.text.FieldPosition)
function to format text.
msg
- The formated message to print.objects
- The objects to insert into format string.public static void info(java.lang.String msg, java.lang.Object... objects)
MessageFormat.format(java.lang.Object[], java.lang.StringBuffer, java.text.FieldPosition)
function to format text.
msg
- The formated message to print.objects
- The objects to insert into format string.public static void debug(java.lang.String msg, java.lang.Object... objects)
MessageFormat.format(java.lang.Object[], java.lang.StringBuffer, java.text.FieldPosition)
function to format text.
msg
- The formated message to print.objects
- The objects to insert into format string.public final void setMapFrame(MapFrame map)
null
) the map.
public final void removeLayer(Layer layer)
public static void setInitStatusListener(Main.InitStatusListener listener)
public final void addLayer(Layer layer)
public boolean hasEditLayer()
true
if there is an edit layer
true
if there is an edit layerpublic OsmDataLayer getEditLayer()
null
, if no current edit layer existspublic DataSet getCurrentDataSet()
null
, if no current data set existspublic Layer getActiveLayer()
null
, if currently no active layer existspublic static void redirectToMainContentPane(javax.swing.JComponent source)
public static void registerActionShortcut(JosmAction action)
public static void registerActionShortcut(javax.swing.Action action, Shortcut shortcut)
public static void unregisterShortcut(Shortcut shortcut)
public static void unregisterActionShortcut(JosmAction action)
public static void unregisterActionShortcut(javax.swing.Action action, Shortcut shortcut)
public static void preConstructorInit(java.util.Map<MainApplication.Option,java.util.Collection<java.lang.String>> args)
args
- The parsed argument list.public void postConstructorProcessCmdLine(java.util.Map<MainApplication.Option,java.util.Collection<java.lang.String>> args)
public static boolean saveUnsavedModifications()
public static boolean exitJosm(boolean exit)
private Main.DownloadParamType paramType(java.lang.String s)
s
- A parameter string
private static void downloadFromParamHttp(boolean rawGps, java.lang.String s)
rawGps
- Flag to download raw GPS trackss
- The URL parameterprivate static void downloadFromParamBounds(boolean rawGps, java.lang.String s)
rawGps
- Flag to download raw GPS trackss
- The bounds parameterprivate static void downloadFromParamBounds(boolean rawGps, Bounds b)
rawGps
- Flag to download raw GPS tracksb
- The bounds valuedownloadFromParamBounds(boolean, String)
,
downloadFromParamHttp(boolean, java.lang.String)
public static void determinePlatformHook()
public static void addListener()
public static void checkJava6()
public static Projection getProjection()
public static void setProjection(Projection p)
p
- the projectionprivate static void fireProjectionChanged(Projection oldValue, Projection newValue, Bounds oldBounds)
public static void addProjectionChangeListener(ProjectionChangeListener listener)
listener
- the listener. Ignored if null
.public static void removeProjectionChangeListener(ProjectionChangeListener listener)
listener
- the listener. Ignored if null
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |