use of org.hortonmachine.gui.utils.DefaultGuiBridgeImpl in project hortonmachine by TheHortonMachine.
the class LasInfoController method main.
public static void main(String[] args) {
GuiUtilities.setDefaultLookAndFeel();
DefaultGuiBridgeImpl gBridge = new DefaultGuiBridgeImpl();
final LasInfoController controller = new LasInfoController();
final JFrame frame = gBridge.showWindow(controller.asJComponent(), "HortonMachine Las Info Viewer");
GuiUtilities.setDefaultFrameIcon(frame);
GuiUtilities.addClosingListener(frame, controller);
}
use of org.hortonmachine.gui.utils.DefaultGuiBridgeImpl in project hortonmachine by TheHortonMachine.
the class SpatialtoolboxController method main.
public static void main(String[] args) throws Exception {
GuiUtilities.setDefaultLookAndFeel();
File libsFile = null;
try {
String libsPath = args[0];
libsFile = new File(libsPath);
} catch (Exception e1) {
// IGNORE
}
if (libsFile == null || !libsFile.exists() || !libsFile.isDirectory()) {
Logger.INSTANCE.insertWarning("", "The libraries folder is missing or not properly set.");
libsFile = new File("/home/hydrologis/development/hortonmachine-git/extras/deploy/libs");
if (!libsFile.exists()) {
libsFile = new File("/Users/hydrologis/development/hortonmachine-git/extras/deploy/libs");
}
// System.exit(1);
}
Logger.INSTANCE.insertInfo("", "Libraries folder used: " + libsFile.getAbsolutePath());
HortonmachineModulesManager.getInstance().init();
DefaultGuiBridgeImpl gBridge = new DefaultGuiBridgeImpl();
gBridge.setLibsFolder(libsFile);
final SpatialtoolboxController controller = new SpatialtoolboxController(gBridge);
final JFrame frame = gBridge.showWindow(controller.asJComponent(), "The HortonMachine Spatial Toolbox");
GuiUtilities.setDefaultFrameIcon(frame);
GuiUtilities.addClosingListener(frame, controller);
}
use of org.hortonmachine.gui.utils.DefaultGuiBridgeImpl in project hortonmachine by TheHortonMachine.
the class DatabaseViewer method main.
public static void main(String[] args) throws Exception {
GuiUtilities.setDefaultLookAndFeel();
DefaultGuiBridgeImpl gBridge = new DefaultGuiBridgeImpl();
final DatabaseViewer controller = new DatabaseViewer(gBridge);
SettingsController.applySettings(controller);
final JFrame frame = gBridge.showWindow(controller.asJComponent(), "HortonMachine Database Viewer");
GuiUtilities.setDefaultFrameIcon(frame);
GuiUtilities.addClosingListener(frame, controller);
File openFile = null;
if (args.length > 0 && new File(args[0]).exists()) {
openFile = new File(args[0]);
} else {
String lastPath = PreferencesHandler.getPreference(DatabaseGuiUtils.HM_SPATIALITE_LAST_FILE, (String) null);
if (lastPath != null) {
File tmp = new File(lastPath);
if (tmp.exists()) {
openFile = tmp;
}
}
}
if (openFile != null) {
String absolutePath = openFile.getAbsolutePath();
EDb dbType = null;
if (SpatialiteCommonMethods.isSqliteFile(openFile)) {
if (absolutePath.endsWith(EDb.GEOPACKAGE.getExtension())) {
dbType = EDb.GEOPACKAGE;
} else {
dbType = EDb.SPATIALITE;
}
} else if (absolutePath.endsWith(EDb.H2GIS.getExtension())) {
dbType = EDb.H2GIS;
} else {
absolutePath = null;
}
controller.openDatabase(dbType, absolutePath, null, null);
}
}
use of org.hortonmachine.gui.utils.DefaultGuiBridgeImpl in project hortonmachine by TheHortonMachine.
the class SqlTemplatesAndActions method getOpenInSldEditorAction.
public Action getOpenInSldEditorAction(TableLevel table, DatabaseViewer spatialiteViewer) {
if (isNosql) {
return null;
}
if (spatialiteViewer.currentConnectedSqlDatabase.getType() == EDb.GEOPACKAGE || spatialiteViewer.currentConnectedSqlDatabase.getType() == EDb.POSTGRES || spatialiteViewer.currentConnectedSqlDatabase.getType() == EDb.POSTGIS) {
return new AbstractAction("Open in SLD editor") {
@Override
public void actionPerformed(ActionEvent e) {
try {
DefaultGuiBridgeImpl gBridge = new DefaultGuiBridgeImpl();
String databasePath = spatialiteViewer.currentConnectedSqlDatabase.getDatabasePath();
final MainController controller = new MainController(new File(databasePath), table.tableName);
final JFrame frame = gBridge.showWindow(controller.asJComponent(), "HortonMachine SLD Editor");
Class<DatabaseViewer> class1 = DatabaseViewer.class;
ImageIcon icon = new ImageIcon(class1.getResource("/org/hortonmachine/images/hm150.png"));
frame.setIconImage(icon.getImage());
} catch (Exception ex) {
ex.printStackTrace();
}
}
};
} else {
return null;
}
}
use of org.hortonmachine.gui.utils.DefaultGuiBridgeImpl in project hortonmachine by TheHortonMachine.
the class SqlTemplatesAndActions method getOpenInGformsEditorAction.
public Action getOpenInGformsEditorAction(TableLevel table, DatabaseViewer spatialiteViewer) {
if (isNosql) {
return null;
}
if (spatialiteViewer.currentConnectedSqlDatabase.getType() == EDb.GEOPACKAGE || spatialiteViewer.currentConnectedSqlDatabase.getType() == EDb.POSTGRES || spatialiteViewer.currentConnectedSqlDatabase.getType() == EDb.POSTGIS) {
return new AbstractAction("Open in FORMS editor") {
@Override
public void actionPerformed(ActionEvent e) {
try {
DefaultGuiBridgeImpl gBridge = new DefaultGuiBridgeImpl();
IFormHandler formHandler = new DbFormHandler(spatialiteViewer.currentConnectedSqlDatabase, table.tableName);
final FormBuilderController controller = new FormBuilderController(formHandler);
final JFrame frame = gBridge.showWindow(controller.asJComponent(), "HortonMachine FORMS Editor");
Class<DatabaseViewer> class1 = DatabaseViewer.class;
ImageIcon icon = new ImageIcon(class1.getResource("/org/hortonmachine/images/hm150.png"));
frame.setIconImage(icon.getImage());
} catch (Exception ex) {
ex.printStackTrace();
}
}
};
} else {
return null;
}
}
Aggregations