initialize

This commit is contained in:
Pruefer
2025-06-06 09:15:13 +02:00
commit fa7c2730f1
5817 changed files with 1339670 additions and 0 deletions

32
interface/gui/.classpath Normal file
View File

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

36
interface/gui/.project Normal file
View File

@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>data-interface-gui</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
</natures>
</projectDescription>

View File

@@ -0,0 +1,4 @@
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8
encoding/<project>=UTF-8

View File

@@ -0,0 +1,8 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.8

View File

@@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="data-interface-gui">
<wb-resource deploy-path="/" source-path="/src/main/java"/>
<wb-resource deploy-path="/" source-path="/src/main/resources"/>
</wb-module>
</project-modules>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<installed facet="java" version="1.8"/>
<installed facet="jst.utility" version="1.0"/>
</faceted-project>

View File

@@ -0,0 +1,2 @@
disabled=06target
eclipse.preferences.version=1

52271
interface/gui/itac_0.log Normal file

File diff suppressed because one or more lines are too long

View File

104
interface/gui/pom.xml Normal file
View File

@@ -0,0 +1,104 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-gui</artifactId>
<packaging>jar</packaging>
<name>data-interface-gui</name>
<version>${mes.interface.version}</version>
<parent>
<groupId>com.itac.interface</groupId>
<artifactId>data-interface</artifactId>
<version>${mes.interface.version}</version>
</parent>
<dependencies>
<dependency>
<groupId>com.itac.product</groupId>
<artifactId>artes-client</artifactId>
</dependency>
<dependency>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-remote-gui-definition</artifactId>
</dependency>
<!-- interner -->
<dependency>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-remote-gui</artifactId>
</dependency>
<dependency>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-core</artifactId>
</dependency>
<dependency>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-remote-gui-definition</artifactId>
</dependency>
<dependency>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-fuji</artifactId>
</dependency>
<dependency>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-fuji-definition</artifactId>
</dependency>
<dependency>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-cogiscan-interface</artifactId>
</dependency>
<dependency>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-asm-interface</artifactId>
</dependency>
<dependency>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-panasonic</artifactId>
</dependency>
<dependency>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-yamaha-interface</artifactId>
</dependency>
<dependency>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>imsinterfaces-samsung</artifactId>
</dependency>
<dependency>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-line-dashboard-interface</artifactId>
</dependency>
<dependency>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-machine</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.itac.tools</groupId>
<artifactId>webstart-plugin</artifactId>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>itacWebstartClient</goal>
</goals>
</execution>
</executions>
<configuration>
<applicationName>DataInterfaceClient.jnlp</applicationName>
<title>iTAC.MES.DataInterface Client</title>
<description>iTAC.MES.DataInterface Client</description>
<category>standard</category>
<mainClass>com.itac.mes.datainterface.DataInterfaceWithGui</mainClass>
<offlineAllowed>true</offlineAllowed>
<!-- optional params -->
<shortdescription>iTAC.MES.Suite with gui</shortdescription>
<tooltip>iTAC.MES.DataInterface Client</tooltip>
<icon>com/itac/resource/binaries/companyIcon.png</icon>
<jvmArgs>-showversion</jvmArgs>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@@ -0,0 +1,310 @@
/*
* Copyright (c) 2008 iTAC Software AG, Germany. All Rights Reserved.
*
* This software is protected by copyright. Under no circumstances may any part of this file in any form be copied, printed, edited
* or otherwise distributed, be stored in a retrieval system, or be translated into another language without the written permission
* of iTAC Software AG.
*/
package com.itac.mes.datainterface;
import static com.itac.artes.ArtesPropertyNames.PROP_ARTES_CLUSTERNODES;
import static com.itac.util.PropertyNames.PROP_ITAC_APPID;
import static com.itac.util.logging.LogLevel.ERROR;
import static com.itac.util.logging.LogLevel.FATAL;
import static com.itac.util.logging.LogLevel.INFO;
import static com.itac.util.logging.LogLevel.WARN;
import java.awt.GraphicsConfiguration;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.net.URL;
import javax.jnlp.BasicService;
import javax.jnlp.ServiceManager;
import javax.swing.AbstractAction;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.UIManager;
import com.itac.artes.ihas.LookupException;
import com.itac.mes.datainterface.annotations.AInstantiationType;
import com.itac.mes.datainterface.annotations.InstantiationType;
import com.itac.mes.datainterface.data.Toolbox;
import com.itac.mes.datainterface.factories.AConfigurableHandler;
import com.itac.mes.datainterface.factories.CommonFactory;
import com.itac.mes.datainterface.factories.FactoryException;
import com.itac.mes.datainterface.factories.WorkerPaneFactory;
import com.itac.mes.datainterface.gui.DIMAPropertyChangeListener;
import com.itac.mes.datainterface.gui.DataInterfaceDlg;
import com.itac.mes.datainterface.gui.DataInterfaceMenuAction;
import com.itac.mes.datainterface.gui.IMainDlg;
import com.itac.mes.datainterface.gui.IWorkerPane;
import com.itac.mes.datainterface.service.DataInterfaceServices;
import com.itac.mes.datainterface.work.Simulation;
import com.itac.mes.datainterface.work.Worker;
import com.itac.resource.ResourcePool;
import com.itac.resource.ResourcesIMSInterfaces;
import com.itac.resource.ResourcesInterfaceFramework;
import com.itac.util.logging.LogHandler;
/**
* Das ist die Hauptklasse des DataInterface. Das DataInterface bietet die Moeglichkeit ueber einen Plugin-Mechanismus
* verschiedenste Auspraegungen eine Interface zu instantiieren.
*
* @author frankp
*/
@AInstantiationType(name = "client", type = InstantiationType.TOOL)
public class DataInterfaceWithGui extends DataInterfaceClient implements DIMAPropertyChangeListener {
public static final String APPTYPE = "DataInterface";
public static DataInterfaceWithGui dataInterface;
private Worker worker;
// Maschinen Simulationen werden hiervon gemanaged
private Simulation simulation;
private IMainDlg dataInterfaceDlg;
private WindowSettings windowSettings;
// it's required to have those parameters here to create them automatically on starting as webstart appliation
private RemoteLocation remoteLocation;
private CommonFactory<AConfigurableHandler> factory;
/**
* @param factory
* @param args
*/
public DataInterfaceWithGui(CommonFactory<AConfigurableHandler> factory, String[] args) {
super();
this.factory = factory;
}
public static void main(String[] args) {
if (System.getProperty(PROP_ARTES_CLUSTERNODES) == null) {
try {
BasicService bs = (BasicService) ServiceManager.lookup("javax.jnlp.BasicService");
URL url = bs.getCodeBase();
// die folgende Erkennung muss bei "normalen" und "custom" Interface funktionieren
// http://localhost:8080/imsinterfaces/webstart
// http://localhost:8080/imsinterfaces-customer/webstart
// url parsing unterschiedlich
URL newUrl = new URL(url.getProtocol(), url.getHost(), url.getPort(), "/mes");
String value = newUrl.toString();
System.out.println("autodetect: set property " + PROP_ARTES_CLUSTERNODES + " to " + value);
System.setProperty(PROP_ARTES_CLUSTERNODES, value);
} catch (Exception ex) {
LogHandler.log(APPTYPE, ERROR, "automatic detection of MES failed", ex);
}
}
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception cnfe) {
// keep System err and printStackTrace, because at the moment of calling logging is not initialized
System.err.println("Failed to set LookAndFeel");
cnfe.printStackTrace();
}
try {
// create the compontnFactory
CommonFactory<AConfigurableHandler> factory = new CommonFactory<AConfigurableHandler>();
// check access to imsServices
DataInterfaceServices services = (DataInterfaceServices) factory.get(DataInterfaceServices.class, "");
// access to imsApi granted
// special case: create and set DataInterfaceConfig explicit; this is not an instance of AConfigurableHandler
DataInterfaceConfiguration configuration = new DataInterfaceConfiguration(services);
factory.setDataInterfaceConfiguration(configuration);
factory.callAtInit();
DataInterfaceWithGui.dataInterface = new DataInterfaceWithGui(factory, args);
DataInterfaceWithGui.dataInterface.start();
} catch (ConfigurationUpdateException ex) {
JOptionPane.showMessageDialog(null, ResourcePool.getInstance().getString(ResourcesIMSInterfaces.UPDATE_PARAMETER), APPTYPE,
JOptionPane.INFORMATION_MESSAGE);
System.exit(0);
} catch (LookupException ex) {
LogHandler.log(APPTYPE, ERROR, "lookup failed", ex);
DataInterfaceWithGui.dataInterface.finish();
} catch (ConfigurationException ex) {
LogHandler.log(APPTYPE, ERROR, "Loading configuration failed", ex);
JOptionPane.showMessageDialog(null, ex.getMessage(), APPTYPE, JOptionPane.INFORMATION_MESSAGE);
System.exit(0);
} catch (FactoryException ex) {
LogHandler.log(APPTYPE, ERROR, "Factory Exception", ex);
DataInterface.dataInterface.finish();
} catch (Exception e) {
LogHandler.log(APPTYPE, ERROR, "Exception", e);
DataInterface.dataInterface.finish();
}
}
@Override
public void start() throws FactoryException, ConfigurationException {
// implizites erzeugen aller Dienste etc.
super.start();
Toolbox toolbox = (Toolbox) factory.deepCreate(Toolbox.class.getName(), "");
// jetzt muessen alle annotierten Elemente in der Toolbox erzeugt worden sein.
if (toolbox.getConfigurationResult() != OK) {
writeMessage(ERROR, toolbox.getConfigurationText());
}
// put the own (full qualified, z.B. itacpc333.itac.intra to the configuration
// in combination with the configured port the DataInterfaceAdminconsole can
// remote connect to this instance
remoteLocation = (RemoteLocation) factory.deepCreate(RemoteLocation.class.getName(), "");
if (remoteLocation.getConfigurationResult() != AConfigurableHandler.OK) {
writeMessage(ERROR, remoteLocation.getConfigurationText());
}
remoteLocation.updateHostname();
windowSettings = (WindowSettings) factory.deepCreate(WindowSettings.class.getName(), "");
if (windowSettings.getConfigurationResult() != OK) {
writeMessage(ERROR, windowSettings.getConfigurationText());
}
dataInterfaceDlg = new DataInterfaceDlg();
if (dataInterfaceDlg instanceof DataInterfaceDlg) {
// Operation, die nur auf einem JFrame funktioniert
((JFrame) dataInterfaceDlg).addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
finish();
}
});
((DataInterfaceDlg) dataInterfaceDlg).getMniExit().setAction(
new AbstractAction(ResourcePool.getInstance().getString(ResourcesInterfaceFramework.INTERFACEFRAMEWORK_MENU_EXIT)) {
@Override
public void actionPerformed(ActionEvent e) {
finish();
}
});
// window Position and size
initDialog();
}
WorkerPaneFactory wpf = new WorkerPaneFactory(WorkerPaneFactory.MODE.WITH_GUI);
IWorkerPane interfaceMainPane = wpf.getOrCreateWorkerPane(DataInterfaceDlg.INTERFACE_TAB_NAME);
// IWorkerPane interfaceMainPane = dataInterfaceDlg.getOrCreateWorkerPane(DataInterfaceDlg.INTERFACE_TAB_NAME);
dataInterfaceDlg.setMainPaneName(DataInterfaceDlg.INTERFACE_TAB_NAME);
// alle einzel lauffaehige Instanzen
worker = (Worker) factory.deepCreate(Worker.class.getName(), "");
if (worker.getConfigurationResult() != AConfigurableHandler.OK) {
writeMessage(ERROR, worker.getConfigurationText());
}
worker.setWorkerPaneFactory(wpf);
dataInterfaceDlg.setWorker(worker);
dataInterfaceDlg.createWorkerView(interfaceMainPane, null);
factory.addMessageListener(interfaceMainPane);
worker.addMessageListener(interfaceMainPane);
worker.setDIMAPropertyChangeListener(this);
worker.initialize(dataInterfaceDlg, interfaceMainPane, factory);
toolbox.setWorkerInstances(worker.getInstances());
String mainPaneName = DataInterfaceDlg.INTERFACE_TAB_NAME + ", appid=" + System.getProperty(PROP_ITAC_APPID);
interfaceMainPane.setDescription(mainPaneName);
// alle Instanzen, die zu einer Simulation gehoeren
simulation = (Simulation) factory.deepCreate(Simulation.class.getName(), "");
dataInterfaceDlg.setSimulation(simulation);
simulation.initialize(dataInterfaceDlg, interfaceMainPane, factory);
if (toolbox.getConfigurationResult() != OK) {
worker.initFailure(toolbox.getConfigurationText());
}
if (worker.getState() == WARN || worker.getState() == ERROR || worker.getState() == FATAL) {
// 1 tab anzeigen
dataInterfaceDlg.initFailure();
} else {
worker.start();
}
}
public void stop() {
try {
((DataInterfaceServices) factory.get(DataInterfaceServices.class, "")).logout();
} catch (FactoryException e) {
LogHandler.log(APPTYPE, ERROR, "Logout failed", e);
}
}
protected void finish() {
try {
worker.finish();
} catch (Throwable th) {
LogHandler.log(APPTYPE, ERROR, "finish failed", th);
}
if (dataInterfaceDlg instanceof DataInterfaceDlg) {
// Operation, die nur auf einem JFrame funktioniert
windowSettings.setExtents(((JFrame) dataInterfaceDlg).getBounds());
windowSettings.setExtendedState(((JFrame) dataInterfaceDlg).getExtendedState());
}
System.exit(0);
}
private void initDialog() {
Rectangle extents = windowSettings.getExtents();
Point position = new Point(extents.x, extents.y);
GraphicsConfiguration gc = null;
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice[] gd = ge.getScreenDevices();
for (GraphicsDevice element : gd) {
if (element.getType() == GraphicsDevice.TYPE_RASTER_SCREEN) {
GraphicsConfiguration dgc = element.getDefaultConfiguration();
Rectangle bounds = dgc.getBounds();
if (bounds.contains(position)) {
gc = dgc;
break;
}
}
}
if (gc == null) {
LogHandler.log(APPTYPE, INFO, "setting windows top left position to 0,0");
position.x = 0;
position.y = 0;
}
if (dataInterfaceDlg instanceof DataInterfaceDlg) {
// Operation, die nur auf einem JFrame funktioniert
dataInterfaceDlg.setTitle(windowSettings.getTitle());
((JFrame) dataInterfaceDlg).setLocation(position.x, position.y);
if (extents.width != 0 && extents.height != 0) {
((JFrame) dataInterfaceDlg).setSize(extents.width, extents.height);
}
}
dataInterfaceDlg.setVisible(true);
((JFrame) dataInterfaceDlg).setExtendedState(windowSettings.getExtendedState());
}
@Override
public void propertiesChanged(DataInterfaceMenuAction menuAction) {
// delegate changed properties
try {
if (worker != null) {
worker.notifyActionPropertiesChanged(menuAction.getInstanceName(), menuAction);
}
if (simulation != null) {
simulation.notifyActionPropertiesChanged(menuAction.getInstanceName(), menuAction);
}
} catch (Exception e) {
}
}
}

View File

@@ -0,0 +1,144 @@
/*
* Copyright (c) 2013 iTAC Software AG, Germany. All Rights Reserved.
*
* This software is protected by copyright. Under no circumstances may any part of this file in any form be copied,
* printed, edited or otherwise distributed, be stored in a retrieval system, or be translated into another language
* without the written permission of iTAC Software AG.
*/
package com.itac.mes.datainterface;
import static com.itac.mes.datainterface.ParameterUpdateTool.DEFAULT_DIM_PATH;
import static com.itac.mes.datainterface.ParameterUpdateTool.HANDLER_DIM_PATH;
import static com.itac.util.logging.LogLevel.ERROR;
import static com.itac.util.logging.LogLevel.INFO;
import java.awt.Frame;
import javax.swing.JFrame;
import com.itac.mes.config.domain.Parameter;
import com.itac.mes.datainterface.annotations.AInstantiationType;
import com.itac.mes.datainterface.annotations.AParamValue;
import com.itac.mes.datainterface.annotations.AParameter;
import com.itac.mes.datainterface.annotations.AParameterDefaultValue;
import com.itac.mes.datainterface.annotations.InstantiationType;
import com.itac.mes.datainterface.factories.AConfigurableHandler;
import com.itac.util.logging.LogHandler;
/**
* Zugriff auf Fenstereinstellungen, Titel, Positionen etc.
*
* @author frankp
* @since 17.04.2013
*/
@AInstantiationType(name = "windowsettings", type = InstantiationType.TOOL, createRootParameter = true, singleton = true)
public class WindowSettings extends AConfigurableHandler {
private static final String LOGGER = WindowSettings.class.getSimpleName();
public static final String WINDOW = "window";
public static final String TITLE = WINDOW + ".title";
public static final String POSITION = WINDOW + ".position";
public static final String WINDOW_POSITION = WINDOW + ".windowPosition";
public static final String STATE = WINDOW + ".extendedState";
@AParameter(name = WINDOW, description = "window settings", dimPath = DEFAULT_DIM_PATH, ordering = "2050")
private Parameter paramRoot;
@AParameter(name = TITLE, parent = WINDOW, description = "window title", type = String.class, dimPath = DEFAULT_DIM_PATH)
private Parameter paramTitle;
@AParameter(name = POSITION, parent = WINDOW, description = "window position", type = java.awt.Rectangle.class,
dimPath = HANDLER_DIM_PATH)
private Parameter paramPosition;
@AParameter(name = STATE, parent = WINDOW, description = "extended window state", type = String.class, dimPath = DEFAULT_DIM_PATH)
private Parameter paramWindowState;
@AParameterDefaultValue(name = STATE)
private String state = "normal";
@AParamValue(value = TITLE)
private String title;
@AParamValue(value = POSITION, allowEmpty = true)
private java.awt.Rectangle extents = new java.awt.Rectangle(0, 0, 600, 400);
private int extendedState = 0;
@AParamValue(value = STATE, allowEmpty = true)
protected void setState(String state) {
extendedState = getExtendedState(state);
}
private int getExtendedState(String sExtendedString) {
extendedState = 0;
if (sExtendedString.contains("normal")) {
extendedState = extendedState | JFrame.NORMAL;
}
if (sExtendedString.contains("iconified")) {
extendedState = extendedState | JFrame.ICONIFIED;
}
if (sExtendedString.contains("maximized")) {
extendedState = extendedState | JFrame.MAXIMIZED_BOTH;
}
if (sExtendedString.contains("maximized_horiz")) {
extendedState = extendedState | JFrame.MAXIMIZED_HORIZ;
}
if (sExtendedString.contains("maximized_vert")) {
extendedState = extendedState | JFrame.MAXIMIZED_VERT;
}
return extendedState;
}
/**
* @return der gespeicherte Title fuer diesen Dialog
*/
public String getTitle() {
return title == null ? "" : title;
}
/**
* @return die gespeicherte Fensterpositionen fuer diesen Dialog
*/
public java.awt.Rectangle getExtents() {
return extents;
}
public int getExtendedState() {
return JFrame.NORMAL;
}
public void setExtendedState(int iExtendedState) {
// aus dem extended State einen String machen, diesen speichern
LogHandler.log(LOGGER, INFO, "updating window state");
String extString = "";
if (iExtendedState == Frame.NORMAL) {
extString = "normal";
} else {
if ((iExtendedState & Frame.ICONIFIED) != 0) {
extString = "iconified";
}
if ((iExtendedState & Frame.MAXIMIZED_BOTH) == Frame.MAXIMIZED_BOTH) {
extString = "maximized";
} else if ((iExtendedState & Frame.MAXIMIZED_HORIZ) != 0) {
extString = "maximized_horiz";
} else if ((iExtendedState & Frame.MAXIMIZED_VERT) != 0) {
extString = "maximized_vert";
}
}
try {
updateValue(STATE, extString);
} catch (Exception e) {
LogHandler.log(LOGGER, ERROR, "unable to update window state in configuration");
}
}
/**
* setting the extents automatically tries to store the extents as new position in configuration
*
* @param bounds
*/
public void setExtents(java.awt.Rectangle bounds) {
LogHandler.log(LOGGER, INFO, "updating window position");
try {
updateValue(POSITION, bounds);
} catch (Exception e) {
LogHandler.log(LOGGER, ERROR, "unable to update window position in configuration");
}
}
}

View File

@@ -0,0 +1,3 @@
# alle verfügbaren FileHandler
com.itac.mes.datainterface.WindowSettings

View File

@@ -0,0 +1,5 @@
Manifest-Version: 1.0
Built-By: frankp
Build-Jdk: 1.8.0_111
Created-By: Maven Integration for Eclipse

View File

@@ -0,0 +1,7 @@
#Generated by Maven Integration for Eclipse
#Tue Oct 13 14:05:25 CEST 2020
version=9.10.00beta-DEVELOPER
groupId=com.itac.interface.interfaces
m2e.projectName=data-interface-gui
m2e.projectLocation=C\:\\projects_jee\\imsinterface\\mainline\\interface\\gui
artifactId=data-interface-gui

View File

@@ -0,0 +1,104 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-gui</artifactId>
<packaging>jar</packaging>
<name>data-interface-gui</name>
<version>${mes.interface.version}</version>
<parent>
<groupId>com.itac.interface</groupId>
<artifactId>data-interface</artifactId>
<version>${mes.interface.version}</version>
</parent>
<dependencies>
<dependency>
<groupId>com.itac.product</groupId>
<artifactId>artes-client</artifactId>
</dependency>
<dependency>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-remote-gui-definition</artifactId>
</dependency>
<!-- interner -->
<dependency>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-remote-gui</artifactId>
</dependency>
<dependency>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-core</artifactId>
</dependency>
<dependency>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-remote-gui-definition</artifactId>
</dependency>
<dependency>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-fuji</artifactId>
</dependency>
<dependency>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-fuji-definition</artifactId>
</dependency>
<dependency>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-cogiscan-interface</artifactId>
</dependency>
<dependency>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-asm-interface</artifactId>
</dependency>
<dependency>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-panasonic</artifactId>
</dependency>
<dependency>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-yamaha-interface</artifactId>
</dependency>
<dependency>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>imsinterfaces-samsung</artifactId>
</dependency>
<dependency>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-line-dashboard-interface</artifactId>
</dependency>
<dependency>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-machine</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.itac.tools</groupId>
<artifactId>webstart-plugin</artifactId>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>itacWebstartClient</goal>
</goals>
</execution>
</executions>
<configuration>
<applicationName>DataInterfaceClient.jnlp</applicationName>
<title>iTAC.MES.DataInterface Client</title>
<description>iTAC.MES.DataInterface Client</description>
<category>standard</category>
<mainClass>com.itac.mes.datainterface.DataInterfaceWithGui</mainClass>
<offlineAllowed>true</offlineAllowed>
<!-- optional params -->
<shortdescription>iTAC.MES.Suite with gui</shortdescription>
<tooltip>iTAC.MES.DataInterface Client</tooltip>
<icon>com/itac/resource/binaries/companyIcon.png</icon>
<jvmArgs>-showversion</jvmArgs>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@@ -0,0 +1,3 @@
# alle verfügbaren FileHandler
com.itac.mes.datainterface.WindowSettings

View File

@@ -0,0 +1,61 @@
package com.itac.mes.datainterface;
public class DataInterfaceWithGuiWebstartLauncher {
public static void main(String[] args) {
try {
System.setProperty("itac.mainclass", "com.itac.mes.datainterface.DataInterfaceWithGui");
setSystemProperties(args[0]);
com.itac.mes.datainterface.DataInterfaceWithGui.main(new String[]{});
} catch(Exception e) {
throw new RuntimeException("Unable to execute com.itac.mes.datainterface.DataInterfaceWithGui.main()", e);
}
}
private static void setSystemProperties(String complete) {
boolean isEscape = false;
boolean isValue = false;
StringBuilder key = new StringBuilder();
StringBuilder value = new StringBuilder();
for (int i=0; i<complete.length(); i++) {
char c = complete.charAt(i);
if (c == ',') {
if (isEscape) {
if (isValue) {
value.append(c);
} else {
key.append(c);
}
isEscape = false;
} else {
System.setProperty(key.toString(), value.toString());
key = new StringBuilder();
value = new StringBuilder();
isEscape = false;
isValue = false;
}
} else if (c == '\\') {
if (isEscape) {
if (isValue) {
value.append(c);
} else {
key.append(c);
}
isEscape = false;
} else {
isEscape = true;
}
} else if (c == '=') {
isValue = true;
} else {
if (isValue) {
value.append(c);
} else {
key.append(c);
}
}
}
System.setProperty(key.toString(), value.toString());
}
}

View File

@@ -0,0 +1,5 @@
#Generated by Maven
#Tue Jun 12 15:26:05 CEST 2018
version=9.00.01alpha-DEVELOPER
groupId=com.itac.interface.interfaces
artifactId=data-interface-gui