16 package net.squiz.matrix.core;
18 import net.squiz.matrix.matrixtree.*;
19 import net.squiz.matrix.ui.ErrorDialog;
24 import java.awt.event.*;
32 private static Map icons =
new HashMap();
33 private static JPopupMenu addMenu;
45 public static void error(Component comp, String message, String title) {
47 MatrixTree tree = MatrixTreeBus.getActiveTree();
49 JOptionPane.showMessageDialog(
53 JOptionPane.ERROR_MESSAGE
67 public static void error(String message, String title) {
69 error(null, message, title);
89 if (!icons.containsKey(path)) {
91 Icon icon =
new ImageIcon(
93 icons.put(path, icon);
95 }
catch (MalformedURLException mue) {
99 return (Icon) icons.get(path);
119 +
"/" + typeCode +
"/" +
"icon.png");
127 if (icons.containsKey(
Matrix.
getProperty(
"parameter.url.typecodeurl") +
"/" + typeCode +
"/" +
"icon.png")) {
141 public static Icon getCompoundIconForTypeCode(
143 String compoundIconName,
146 String key =
"__compound_icon_" + assetId;
147 if (!icons.containsKey(key)) {
150 +
"/" + compoundIconName);
156 SwingConstants.BOTTOM
158 icons.put(key, icon);
161 return (Icon) icons.get(key);
170 Dimension size = Toolkit.getDefaultToolkit().getScreenSize();
171 int x = (int) (size.getWidth() - comp.getWidth()) / 2;
172 int y = (int) (size.getHeight() - comp.getHeight()) / 2;
173 comp.setLocation(x, y);
174 comp.setVisible(
true);
184 if ((evt.getModifiers() & MouseEvent.BUTTON3_MASK) == MouseEvent.BUTTON3_MASK)