// ********************************************************************** // // $Source: /cvs/CVS_LEBA/common/jstd/src/java/com/obrctm/openmap/editor/IconPalette.java,v $ // $RCSfile: IconPalette.java,v $ // $$Wersion: 1.0 $ // $Date: 2003/07/25 15:06:06 $ // $Author: pitek $ // // ********************************************************************** package com.obrctm.openmap.editor; import javax.swing.JToggleButton; /** * Interfejs do prezentacji. */ public class IconPalette extends javax.swing.JDialog { /** Wielkosc obszaru dla prezentowanej ikony w pikselach */ private static int sizeImageIcon = 40; private EditableOMIcon cEditableOMIcon = null; protected String activeButton = null; /** Creates new form */ public IconPalette(java.awt.Frame parent, boolean modal, String aForecast) { super(parent, modal); initComponents(); } public final static String buttonIconCommand = "ButtonIcon"; public void initSymbols(EditableOMIcon aEditableOMIcon) { cEditableOMIcon = aEditableOMIcon; String[] listSymbolFile = cEditableOMIcon.getListSymbols(); if((listSymbolFile == null) || (listSymbolFile.length == 0)) return; int rowCount; int columnCount; if(listSymbolFile.length < 16) { columnCount = 4; rowCount = listSymbolFile.length / columnCount; if((listSymbolFile.length % columnCount) > 0) rowCount++; } else { rowCount = (int)java.lang.Math.sqrt(listSymbolFile.length); columnCount = listSymbolFile.length / rowCount; if((listSymbolFile.length % rowCount) > 0) columnCount++; } JToggleButton jImageSymbolButton; for(int i=0; i