GMSC Discussions

GeoMedia Smart Client community discussion board is where you can create, contribute and share information and knowledge in regards to configuring as well as working with GeoMedia Smart Client. Find your answers, share your knowledge and help build a strong GeoMedia Smart Client community.
Showing results for 
Search instead for 
Do you mean 
Reply
Highlighted
Contributor
Posts: 20
Registered: ‎10-09-2017
Accepted Solution

Customizing theme for GMSC Client-Side

[ Edited ]

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. 

 

screenshot.jpg

 

Thank you.

Highlighted
Frequent Contributor
Posts: 119
Registered: ‎04-05-2016

Re: Customizing theme for GMSC Client-Side

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

Highlighted
Contributor
Posts: 20
Registered: ‎10-09-2017

Re: Customizing theme for GMSC Client-Side

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?

Highlighted
Frequent Contributor
Posts: 119
Registered: ‎04-05-2016

Re: Customizing theme for GMSC Client-Side

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);
	}
}
Highlighted
Contributor
Posts: 20
Registered: ‎10-09-2017

Re: Customizing theme for GMSC Client-Side

Lovely! Thank you very much for your wonderful help Sven!