09-29-2019 09:06 PM - edited 09-29-2019 09:14 PM
Hi,
I would like to know if we could customize the theme for Geomedia Smart Client User Interface as highlighted in the red boxes in the figure below.
My client has specified the theme and I've successfully customized the workflow theme according to the specification as can be seen in the screenshot provided. However, I would also like to change the main menu window and the rest according to the specified theme.
Thank you.
Solved! Go to Solution.
09-29-2019 09:55 PM
Hi Jasmine,
I think unlike in workflows you can change the style of GMSC client components only in Java code which you would have to implement as a plugin. The UI consists of swing components you can programmatically change when GMSC starts up.
Regards,
Sven
09-29-2019 11:49 PM
Hi Sven,
Thank you very much for your reply and I fully understood it. Do you have any samples on how I can do the styling in Java?
09-30-2019 01:22 AM
Hi Jasmine,
here is a very quick and dirty example I made on how to set the background color for all UI components of the GMSC client programatically just to give you an idea on how to get started with it:
package com.intergraph.web.stylingExample; import java.awt.Color; import java.awt.Component; import java.awt.Container; import java.util.ArrayList; import java.util.List; import javax.swing.JRootPane; import com.intergraph.tools.utils.disptach.annotations.Plugin; import com.intergraph.web.core.kernel.ApplicationContext; import com.intergraph.web.core.kernel.plugin.AbstractPlugin; import com.intergraph.web.viewer.map.GMap; @Plugin(alias = "StylingExamplePlugin", vendor = "HxGN Safety & Infrastructure GmbH", id = "91504539-9fca-4ce9-9ac3-d9a799d484f1") public class StylingExamplePlugin extends AbstractPlugin { List<Component> components = new ArrayList<Component>(); @Override public void loadOnStart() { Component[] comps = ApplicationContext.getMainFrame().getComponents(); JRootPane rootPane = (JRootPane)comps[0]; loadComponents(rootPane); for (Component component : components) { if (!(component instanceof GMap)) { setBackgroundColor(component, Color.BLUE); } } } private void loadComponents(Component comp) { components.add(comp); if (comp instanceof Container) { for (Component child : ((Container)comp).getComponents()) { loadComponents(child); } } } private void setBackgroundColor(Component comp, Color color) { comp.setBackground(color); } }
09-30-2019 07:01 PM
Lovely! Thank you very much for your wonderful help Sven!