Package org.beryl.gui

Examples of org.beryl.gui.GUIException


      widget.setDataModel(debuggingMapDataModel);

      return widget;
    } catch (ClassNotFoundException e) {
      throw new GUIException("Unknown widget class [" + className + "]");
    } catch (NoSuchMethodException e) {
      throw new GUIException("Widget constructor not found", e);
    } catch (IllegalAccessException e) {
      throw new GUIException("Widget constructor could not be called", e);
    } catch (InstantiationException e) {
      throw new GUIException("Widget is abstract", e);
    } catch (InvocationTargetException e) {
      throw new GUIException("Widget constructor threw an exception", e);
    }
  }
View Full Code Here


    PropertyAdapter adapter = (PropertyAdapter) propertyAdapters.get(propertyNode.getAttribute("type"));
    if (adapter != null)
      return adapter;
    else
      throw new GUIException("Unknown property type [" + propertyNode.getAttribute("type") + "]");
  }
View Full Code Here

          dataModel.setValue("hig_row", pos.nextToken());
          dataModel.setValue("hig_column", pos.nextToken());
          dataModel.setValue("hig_width", pos.nextToken());
          dataModel.setValue("hig_height", pos.nextToken());
        } else {
          throw new GUIException("Bad anchor argument count");
        }

        dataModel.setValue("hig_l", new Boolean(align.indexOf('l') != -1));
        dataModel.setValue("hig_r", new Boolean(align.indexOf('r') != -1));
        dataModel.setValue("hig_t", new Boolean(align.indexOf('t') != -1));
        dataModel.setValue("hig_b", new Boolean(align.indexOf('b') != -1));
      } catch (NumberFormatException e) {
        throw new GUIException("Invalid anchor data", e);
      }
    } else if (type.equals("border")) {
      dataModel.setValue("type", dialog.getWidget("border"));

      dataModel.setValue("border", dialog.getWidget(anchorNode.getAttribute("border")));
View Full Code Here

      else if (type.equals("float"))
        textField.addValidator(new FloatValidator());
      else if (type.equals("double"))
        textField.addValidator(new DoubleValidator());
      else
        throw new GUIException("Unknown numeric type");

      panel.addChild(textField, null);
      panel.recursiveSetDataModel(dataModel);

      return panel;
View Full Code Here

      document = dbf.newDocumentBuilder().newDocument();
      Element uiElement = document.createElement("UI");
      uiElement.setAttribute("version", "1.0");
      document.appendChild(uiElement);
    } catch (ParserConfigurationException e) {
      throw new GUIException("Error while initializing XML parser", e);
    }
    modified = false;
    doRefresh();
  }
View Full Code Here

      try {
        PrintWriter writer = new PrintWriter(new FileOutputStream(file));
        writer.println(XMLUtils.serializeXML(document));
        writer.close();
      } catch (IOException e) {
        throw new GUIException("Could not create file", e);
      }
      modified = false;
    }
  }
View Full Code Here

    File newFile = DialogUtils.showOpenFileDialog(frame, "xml");
    if (newFile != null) {
      try {
        document = dbf.newDocumentBuilder().parse(newFile);
      } catch (Exception e) {
        throw new GUIException("Could not open file", e);
      }
      file = newFile;
      modified = false;
      doRefresh();
    }
View Full Code Here

    /* Update tree */
    TreeItem parentTreeItem = (TreeItem) moveItem.getParentWidget();
    int treeIndex = parentTreeItem.getChildIndex(moveItem);
    if (treeIndex == -1)
      throw new GUIException("Tree node not found");
    for (int i=0, count=parentTreeItem.getChildCount(); i<count; i++) {
      TreeItem item = (TreeItem) parentTreeItem.getChild(0);
      if (item != moveItem)
        temp.add(item);
      parentTreeItem.removeChildWidget(item);
    }
    temp.add(treeIndex + (up ? -1 : 1), moveItem);
    for (int i=0; i<temp.size(); i++)
      parentTreeItem.addChild((Widget) temp.get(i), null);
    temp.clear();


    /* Update widget */   
    Widget parentWidget = object.widget.getParentWidget();
    int widgetIndex = parentWidget.getChildIndex(object.widget);
    if (widgetIndex == -1)
      throw new GUIException("Widget not found");
    for (int i=0, count=parentWidget.getChildCount(); i<count; i++) {
      Widget widget = (Widget) parentWidget.getChild(0);
      if (widget != object.widget)
        temp.add(widget);
      parentWidget.removeChildWidget(widget);
View Full Code Here

    } else if (type.equals("lowered")) {
      dataModel.setValue("type", dialog.getWidget("lowered"));
    } else if (type.equals("etched")) {
      dataModel.setValue("type", dialog.getWidget("etched"));
    } else {
      throw new GUIException("Unknown border type ["+type+"]");
    }

    activateType(dataModel.getValue("type").toString());
  }
View Full Code Here

TOP

Related Classes of org.beryl.gui.GUIException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.