CPD Results

The following document contains the results of PMD's CPD 5.6.1.

Duplications

File Project Line
org/universAAL/ui/handler/gui/swing/classic/MyVerticalFlowLayout.java universAAL UI Handler Swing Look and Feel Classic 250
org/universAAL/ui/handler/gui/swing/defaultLookAndFeel/Layout/VerticalFlowLayout.java universAAL UI Handler Swing 246
	public MyVerticalFlowLayout(int align, int hgap, int vgap) {
		this.hgap = hgap;
		this.vgap = vgap;
		setAlignment(align);
	}

	/**
	 * Gets the alignment for this layout. Possible values are
	 * <code>MyVerticalFlowLayout.TOP</code>,
	 * <code>MyVerticalFlowLayout.BOTTOM</code>,
	 * <code>MyVerticalFlowLayout.CENTER</code>,
	 * <code>MyVerticalFlowLayout.LEADING</code>, or
	 * <code>MyVerticalFlowLayout.TRAILING</code>.
	 *
	 * @return the alignment value for this layout
	 * @see org.universAAL.ui.handler.gui.swing.defaultLookAndFeel.Layout.VerticalFlowLayout#setAlignment
	 * @since JDK1.1
	 */
	public int getAlignment() {
		return newAlign;
	}

	/**
	 * Sets the alignment for this layout. Possible values are
	 * <ul>
	 * <li><code>MyVerticalFlowLayout.TOP</code>
	 * <li><code>MyVerticalFlowLayout.BOTTOM</code>
	 * <li><code>MyVerticalFlowLayout.CENTER</code>
	 * <li><code>MyVerticalFlowLayout.LEADING</code>
	 * <li><code>MyVerticalFlowLayout.TRAILING</code>
	 * </ul>
	 *
	 * @param align
	 *            one of the alignment values shown above
	 * @see #getAlignment()
	 * @since JDK1.1
	 */
	public void setAlignment(int align) {
		this.newAlign = align;

		// this.align is used only for serialization compatibility,
		// so set it to a value compatible with the 1.1 version
		// of the class

		switch (align) {
		case LEADING:
			this.align = TOP;
			break;
		case TRAILING:
			this.align = BOTTOM;
			break;
		default:
			this.align = align;
			break;
		}
	}

	/**
	 * Gets the horizontal gap between components and between the components and
	 * the borders of the <code>Container</code>
	 *
	 * @return the horizontal gap between components and between the components
	 *         and the borders of the <code>Container</code>
	 * @see org.universAAL.ui.handler.gui.swing.defaultLookAndFeel.Layout.VerticalFlowLayout#setHgap
	 * @since JDK1.1
	 */
	public int getHgap() {
		return hgap;
	}

	/**
	 * Sets the horizontal gap between components and between the components and
	 * the borders of the <code>Container</code>.
	 *
	 * @param hgap
	 *            the horizontal gap between components and between the
	 *            components and the borders of the <code>Container</code>
	 * @see org.universAAL.ui.handler.gui.swing.defaultLookAndFeel.Layout.VerticalFlowLayout#getHgap
	 * @since JDK1.1
	 */
	public void setHgap(int hgap) {
		this.hgap = hgap;
	}

	/**
	 * Gets the vertical gap between components and between the components and
	 * the borders of the <code>Container</code>.
	 *
	 * @return the vertical gap between components and between the components
	 *         and the borders of the <code>Container</code>
	 * @see org.universAAL.ui.handler.gui.swing.defaultLookAndFeel.Layout.VerticalFlowLayout#setVgap
	 * @since JDK1.1
	 */
	public int getVgap() {
		return vgap;
	}

	/**
	 * Sets the vertical gap between components and between the components and
	 * the borders of the <code>Container</code>.
	 *
	 * @param vgap
	 *            the vertical gap between components and between the components
	 *            and the borders of the <code>Container</code>
	 * @see org.universAAL.ui.handler.gui.swing.defaultLookAndFeel.Layout.VerticalFlowLayout#getVgap
	 * @since JDK1.1
	 */
	public void setVgap(int vgap) {
		this.vgap = vgap;
	}

	/**
	 * Adds the specified component to the layout. Not used by this class.
	 *
	 * @param name
	 *            the name of the component
	 * @param comp
	 *            the component to be added
	 */
	public void addLayoutComponent(String name, Component comp) {
	}

	/**
	 * Removes the specified component from the layout. Not used by this class.
	 *
	 * @param comp
	 *            the component to remove
	 * @see java.awt.Container#removeAll
	 */
	public void removeLayoutComponent(Component comp) {
	}

	/**
	 * Returns the preferred dimensions for this layout given the <i>visible</i>
	 * components in the specified target container.
	 *
	 * @param target
	 *            the container that needs to be laid out
	 * @return the preferred dimensions to lay out the subcomponents of the
	 *         specified container
	 * @see Container
	 * @see #minimumLayoutSize
	 * @see java.awt.Container#getPreferredSize
	 */
	public Dimension preferredLayoutSize(Container target) {
		synchronized (target.getTreeLock()) {
			Dimension dim = new Dimension(0, 0);
			int nmembers = target.getComponentCount();
			boolean firstVisibleComponent = true;

			for (int i = 0; i < nmembers; i++) {
				Component m = target.getComponent(i);
				if (m.isVisible()) {
					Dimension d = m.getPreferredSize();
					dim.width = Math.max(dim.width, d.width);
					if (firstVisibleComponent) {
						firstVisibleComponent = false;
					} else {
						dim.height += vgap;
					}
					dim.height += d.height;
				}
			}

			Insets insets = target.getInsets();
			dim.width += insets.left + insets.right + hgap * 2;
			dim.height += insets.top + insets.bottom + vgap * 2;
			return dim;
		}
	}

	/**
	 * Returns the minimum dimensions needed to layout the <i>visible</i>
	 * components contained in the specified target container.
	 *
	 * @param target
	 *            the container that needs to be laid out
	 * @return the minimum dimensions to lay out the subcomponents of the
	 *         specified container
	 * @see #preferredLayoutSize
	 * @see java.awt.Container
	 * @see java.awt.Container#doLayout
	 */
	public Dimension minimumLayoutSize(Container target) {
		synchronized (target.getTreeLock()) {
			Dimension dim = new Dimension(0, 0);
			int nmembers = target.getComponentCount();

			for (int i = 0; i < nmembers; i++) {
				Component m = target.getComponent(i);
				if (m.isVisible()) {
					Dimension d = m.getMinimumSize();
					dim.width = Math.max(dim.width, d.width);
					if (i > 0) {
						dim.height += vgap;
					}
					dim.height += d.height;
				}
			}
			Insets insets = target.getInsets();
			dim.width += insets.left + insets.right + hgap * 2;
			dim.height += insets.top + insets.bottom + vgap * 2;
			return dim;
		}
	}

	/**
	 * Centers the elements in the specified row, if there is any slack.
	 *
	 * @param target
	 *            the component which needs to be moved
	 * @param x
	 *            the x coordinate
	 * @param y
	 *            the y coordinate
	 * @param width
	 *            the width dimensions
	 * @param height
	 *            the height dimensions
	 * @param colStart
	 *            the beginning of the row
	 * @param colEnd
	 *            the the ending of the row
	 */
	private int moveComponents(Container target, int x, int y, int width, int height, int colStart, int colEnd,
File Project Line
org/universAAL/ui/handler/gui/swing/classic/Select1LAF.java universAAL UI Handler Swing Look and Feel Classic 78
org/universAAL/ui/handler/gui/swing/classic/SelectLAF.java universAAL UI Handler Swing Look and Feel Classic 98
		JPanel combined = new JPanel(new BorderLayout(5, 5));
		// combined.add(new JLabel(" "), BorderLayout.EAST);
		// combined.add(new JLabel(" "), BorderLayout.NORTH);
		// combined.add(new JLabel(" "), BorderLayout.SOUTH);
		combined.add(center, BorderLayout.CENTER);
		if (form.getLabel() != null) {
			String title = form.getLabel().getText();
			if (title != null && !title.isEmpty()) {
				combined.add(new JLabel(title), BorderLayout.WEST);
			} /*
				 * else { combined.add(new JLabel(" "), BorderLayout.WEST); }
				 */
		}
		return combined;
	}

	@Override
	public void update() {
		// Do nothing to avoid super
	}

	// TODO Remove this by making it public in model
	public class SelectionTreeModel implements TreeModel {
		Label[] root;

		public Object getRoot() {
			root = ((Select) fc).getChoices();
			if (root.length == 1) {
				return root[1];
			} else {
				return root;
			}
		}

		public Object getChild(Object parent, int index) {
			if (parent == root) {
				return root[index];
			} else {
				return ((ChoiceList) parent).getChildren()[index];
			}
		}

		public int getChildCount(Object parent) {
			if (parent == root) {
				return root.length;
			} else {
				return ((ChoiceList) parent).getChildren().length;
			}
		}

		public boolean isLeaf(Object node) {
			if (node == root) {
				return root.length == 0;
			} else {
				return node instanceof ChoiceItem;
			}
		}

		public void valueForPathChanged(TreePath path, Object newValue) {
			// XXX editable trees?
		}

		public int getIndexOfChild(Object parent, Object child) {
			Label[] children = ((ChoiceList) parent).getChildren();
			int i = 0;
			while (i < children.length && children[i] != child) {
				i++;
			}
			return i;
		}

		public void addTreeModelListener(TreeModelListener l) {
		}

		public void removeTreeModelListener(TreeModelListener l) {
		}

	}

	@Override
	public void updateAsMissing() {
	}

}
File Project Line
org/universAAL/ui/handler/gui/swing/classic/Select1LAF.java universAAL UI Handler Swing Look and Feel Classic 100
org/universAAL/ui/handler/gui/swing/classic/SelectLAF.java universAAL UI Handler Swing Look and Feel Classic 121
org/universAAL/ui/handler/gui/swing/model/FormControl/SelectModel.java universAAL UI Handler Swing 168
	public class SelectionTreeModel implements TreeModel {
		Label[] root;

		public Object getRoot() {
			root = ((Select) fc).getChoices();
			if (root.length == 1) {
				return root[1];
			} else {
				return root;
			}
		}

		public Object getChild(Object parent, int index) {
			if (parent == root) {
				return root[index];
			} else {
				return ((ChoiceList) parent).getChildren()[index];
			}
		}

		public int getChildCount(Object parent) {
			if (parent == root) {
				return root.length;
			} else {
				return ((ChoiceList) parent).getChildren().length;
			}
		}

		public boolean isLeaf(Object node) {
			if (node == root) {
				return root.length == 0;
			} else {
				return node instanceof ChoiceItem;
			}
		}

		public void valueForPathChanged(TreePath path, Object newValue) {
			// XXX editable trees?
		}

		public int getIndexOfChild(Object parent, Object child) {
			Label[] children = ((ChoiceList) parent).getChildren();
			int i = 0;
			while (i < children.length && children[i] != child) {
				i++;
			}
			return i;
		}

		public void addTreeModelListener(TreeModelListener l) {
		}

		public void removeTreeModelListener(TreeModelListener l) {
		}

	}
File Project Line
org/universAAL/ui/handler/gui/swing/classic/MyVerticalFlowLayout.java universAAL UI Handler Swing Look and Feel Classic 518
org/universAAL/ui/handler/gui/swing/defaultLookAndFeel/Layout/VerticalFlowLayout.java universAAL UI Handler Swing 503
	}

	/**
	 * Lays out the container. This method lets each <i>visible</i> component
	 * take its preferred size by reshaping the components in the target
	 * container in order to satisfy the alignment of this
	 * <code>MyVerticalFlowLayout</code> object.
	 *
	 * @param target
	 *            the specified component being laid out
	 * @see Container
	 * @see java.awt.Container#doLayout
	 */
	public void layoutContainer(Container target) {
		synchronized (target.getTreeLock()) {
			Insets insets = target.getInsets();
			int maxwidth = target.getWidth() - (insets.left + insets.right + hgap * 2);
			int maxheight = target.getHeight() - (insets.top + insets.bottom + vgap * 2);
			int nmembers = target.getComponentCount();
			int x = insets.left + hgap, y = 0;
			int colw = 0, start = 0;

			boolean ltr = target.getComponentOrientation().isLeftToRight();

			for (int i = 0; i < nmembers; i++) {
				Component m = target.getComponent(i);
				if (m.isVisible()) {
					Dimension d = m.getPreferredSize();
					if (maximizeOtherDimension) {
						d.width = maxwidth;
					}
					m.setSize(d.width, d.height);

					if ((y == 0) || ((y + d.height) <= maxheight)) {
						if (y > 0) {
							y += vgap;
						}
						y += d.height;
						colw = Math.max(colw, d.width);
					} else {
File Project Line
org/universAAL/ui/dm/ui/preferences/buffer/UISubprofileInitializator.java universAAL UI Dialog Manager 2.0 158
org/universAAL/ui/dm/ui/preferences/buffer/UISubprofileInitializator.java universAAL UI Dialog Manager 2.0 232
		alertPref.setAlertOption(AlertType.visualAndAudio);
		uiPrefsSubProfile.setAlertPreferences(alertPref);

		AccessMode accessMode = new AccessMode(uiPrefsSubProfile.getURI() + "AccessMode");
		accessMode.setAuditoryModeStatus(Status.on);
		accessMode.setOlfactoryModeStatus(Status.off);
		accessMode.setTactileModeStatus(Status.off);
		accessMode.setVisualModeStatus(Status.on);
		accessMode.setTextualModeStatus(Status.on);
		uiPrefsSubProfile.setAccessMode(accessMode);

		AuditoryPreferences auditoryPreferences = new AuditoryPreferences(
				uiPrefsSubProfile.getURI() + "AuditoryPreferences");
		auditoryPreferences.setKeySoundStatus(Status.off);
		auditoryPreferences.setPitch(Intensity.medium);
		auditoryPreferences.setSpeechRate(Intensity.medium);
		auditoryPreferences.setVolume(Intensity.medium);
		auditoryPreferences.setVoiceGender(VoiceGender.female);
		auditoryPreferences.setSystemSounds(Status.on);
		uiPrefsSubProfile.setAudioPreferences(auditoryPreferences);

		SystemMenuPreferences systemMenuPreferences = new SystemMenuPreferences(
				uiPrefsSubProfile.getURI() + "SystemMenuPreferences");
		systemMenuPreferences.setMainMenuConfiguration(MainMenuConfigurationType.taskBar);
		systemMenuPreferences.setUIRequestPersistance(Status.on);
		systemMenuPreferences.setPendingDialogBuilder(PendingDialogsBuilderType.table);
		systemMenuPreferences.setPendingMessageBuilder(PendingMessageBuilderType.simpleTable);
		systemMenuPreferences.setSearchFeatureIsFirst(Status.on);
		uiPrefsSubProfile.setSystemMenuPreferences(systemMenuPreferences);

		VisualPreferences visualPreferences = new VisualPreferences(uiPrefsSubProfile.getURI() + "VisualPreferences");
		visualPreferences.setBackgroundColor(ColorType.lightBlue);
		visualPreferences.setComponentSpacing(Intensity.medium);
File Project Line
org/universAAL/ui/dm/userInteraction/PendingDialogBuilder.java universAAL UI Dialog Manager 2.0 97
org/universAAL/ui/dm/userInteraction/PendingDialogBuilderWithSubmits.java universAAL UI Dialog Manager 2.0 52
		MessageLocaleHelper messageLocaleHelper = userDM.getLocaleHelper();
		List<Resource> dialogs = new ArrayList<Resource>();
		sentItems = new ArrayList<String>();
		Form f = null;
		List<UIRequest> allDialogs = new ArrayList<UIRequest>();
		allDialogs.addAll(dialogPool.listAllSuspended());
		allDialogs.addAll(dialogPool.listAllActive());
		for (UIRequest req : allDialogs) {
			Form tmp = req.getDialogForm();
			Resource aux = new Resource();
			aux.setProperty(PROP_DLG_LIST_DIALOG_DATE, tmp.getCreationTime());
			aux.setProperty(PROP_DLG_LIST_DIALOG_TITLE, tmp.getTitle());
			aux.setProperty(PROP_DLG_LIST_DIALOG_ID, tmp.getDialogID());
			dialogs.add(aux);
			sentItems.add(req.getDialogID());
		}
		// if there are dialogs available for the current user,
		// create a new form with a list of all dialogs
		if (!dialogs.isEmpty()) {
			Resource msgList = new Resource();
			msgList.setProperty(PROP_DLG_LIST_DIALOG_LIST, dialogs);
			msgList.setProperty(PROP_DLG_LIST_SENT_ITEMS, sentItems);
			f = Form.newDialog(messageLocaleHelper.getString(MessageConstants.MENU_PROVIDER_PENDING_DIALOGS), msgList);
File Project Line
org/universAAL/ui/dm/userInteraction/systemMenu/ClassicSystemMenuProvider.java universAAL UI Dialog Manager 2.0 69
org/universAAL/ui/dm/userInteraction/systemMenu/SmartPendingSystemMenuProvider.java universAAL UI Dialog Manager 2.0 72
	public ClassicSystemMenuProvider(UserDialogManager udm) {
		userDM = udm;
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see org.universAAL.ui.dm.interfaces.ISubmitGroupListener#handle(org.
	 * universAAL .middleware.ui.UIResponse)
	 */
	public void handle(UIResponse response) {
		String submissionID = response.getSubmissionID();
		// if (EXIT_CALL.equals(submissionID)) {
		// XXX: do nothing?
		// }
		if (MENU_CALL.equals(submissionID)) {
			userDM.showMainMenu();
		}
		if (MESSAGES_CALL.equals(submissionID)) {
			userDM.openPendingMessagedDialog();
		}
		if (OPEN_DIALOGS_CALL.equals(submissionID)) {
			userDM.openPendingDialogsDialog();
		}

	}

	/*
	 * (non-Javadoc)
	 *
	 * @see org.universAAL.ui.dm.interfaces.ISubmitGroupListener#
	 * listDeclaredSubmitIds ()
	 */
	public Set<String> listDeclaredSubmitIds() {
		TreeSet<String> s = new TreeSet<String>();
		s.add(EXIT_CALL);
		s.add(MENU_CALL);
		s.add(MESSAGES_CALL);
		s.add(OPEN_DIALOGS_CALL);
		return s;
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see
	 * org.universAAL.ui.dm.interfaces.ISystemMenuProvider#getSystemMenu(org.
	 * universAAL.middleware.ui.UIRequest)
	 */
	public Group getSystemMenu(UIRequest request) {
		MessageLocaleHelper messageLocaleHelper = userDM.getLocaleHelper();
		Form f = request.getDialogForm();
		Group stdButtons = f.getStandardButtons();
		switch (f.getDialogType().ord()) {
		case DialogType.SYS_MENU:
File Project Line
org/universAAL/ui/handler/gui/swing/classic/MyVerticalFlowLayout.java universAAL UI Handler Swing Look and Feel Classic 560
org/universAAL/ui/handler/gui/swing/defaultLookAndFeel/Layout/VerticalFlowLayout.java universAAL UI Handler Swing 544
						colw = moveComponents(target, x, insets.top + vgap, colw, maxheight - y, start, i, ltr);
						y = d.height;
						x += hgap + colw;
						colw = d.width;
						start = i;
					}
				}
			}
			moveComponents(target, x, insets.top + vgap, colw, maxheight - y, start, nmembers, ltr);
		}
	}

	//
	// the internal serial version which says which version was written
	// - 0 (default) for versions before the Java 2 platform, v1.2
	// - 1 for version >= Java 2 platform v1.2, which includes "newAlign" field
	//
	private static final int currentSerialVersion = 1;
	/**
	 * This represent the <code>currentSerialVersion</code> which is bein used.
	 * It will be one of two values : <code>0</code> versions before Java 2
	 * platform v1.2.. <code>1</code> versions after Java 2 platform v1.2..
	 *
	 * @serial
	 * @since 1.2
	 */
	private int serialVersionOnStream = currentSerialVersion;

	/**
	 * Reads this object out of a serialization stream, handling objects written
	 * by older versions of the class that didn't contain all of the fields we
	 * use now..
	 */
	private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
		stream.defaultReadObject();

		if (serialVersionOnStream < 1) {
			// "newAlign" field wasn't present, so use the old "align" field.
			setAlignment(this.align);
		}
		serialVersionOnStream = currentSerialVersion;
	}

	/**
	 * Returns a string representation of this <code>MyVerticalFlowLayout</code>
	 * object and its values.
	 *
	 * @return a string representation of this layout
	 */
	public String toString() {
		String str = "";
		switch (align) {
		case TOP:
			str = ",align=top";
			break;
		case CENTER:
			str = ",align=center";
			break;
		case BOTTOM:
			str = ",align=bottom";
			break;
		case LEADING:
			str = ",align=leading";
			break;
		case TRAILING:
			str = ",align=trailing";
			break;
		default: // =CENTER
File Project Line
org/universAAL/ui/handler/gui/swing/classic/SubdialogTriggerLAF.java universAAL UI Handler Swing Look and Feel Classic 94
org/universAAL/ui/handler/gui/swing/classic/SubmitLAF.java universAAL UI Handler Swing Look and Feel Classic 107
					height = SubmitLAF.MIN_HEIGHT;
				Image img, newimg;
				img = ColorLAF.button_normal.getImage();
				newimg = img.getScaledInstance(width, height, java.awt.Image.SCALE_SMOOTH);
				((AbstractButton) e.getComponent()).setIcon(new ImageIcon(newimg));

				img = ColorLAF.button_pressed.getImage();
				newimg = img.getScaledInstance(width, height, java.awt.Image.SCALE_SMOOTH);
				((AbstractButton) e.getComponent()).setPressedIcon(new ImageIcon(newimg));

				img = ColorLAF.button_focused.getImage();
				newimg = img.getScaledInstance(width, height, java.awt.Image.SCALE_SMOOTH);
				((AbstractButton) e.getComponent()).setRolloverIcon(new ImageIcon(newimg));
				// }
			}
		}
	}

	public void componentMoved(ComponentEvent e) {
	}

	public void componentHidden(ComponentEvent e) {
	}

}
File Project Line
org/universAAL/ui/gui/swing/bluesteelLAF/Select1RadioButtonLAF.java universAAL UI Handler Swing Look and Feel Bluesteel 40
org/universAAL/ui/gui/swing/bluesteelLAF/SelectCheckBoxLAF.java universAAL UI Handler Swing Look and Feel Bluesteel 40
	public void update() {
		super.update();
		ColorLAF color = Init.getInstance(getRenderer()).getColorLAF();
		ComponentBorder.addLabeledBorder(getLabelModel().getComponent(), jc, color);
		((JPanel) jc).setLayout(new FormLayout(color.getGap()));
		needsLabel = false;
		Component[] comps = ((JPanel) jc).getComponents();
		for (int i = 0; i < comps.length; i++) {
			comps[i].setMinimumSize(comps[i].getPreferredSize());
			((JComponent) comps[i]).setOpaque(false);
			((JComponent) comps[i]).setToolTipText(((AbstractButton) comps[i]).getText());
		}
	}

	@Override
	public void updateAsMissing() {
		// XXX change coluo?

	}

}
File Project Line
org/universAAL/ui/handler/gui/swing/model/FormControl/RepeatModelGrid.java universAAL UI Handler Swing 142
org/universAAL/ui/handler/gui/swing/model/FormControl/RepeatModelTable.java universAAL UI Handler Swing 133
			buttonPanel.add(new DeleteTableButton());
		}
		return buttonPanel;
	}

	/**
	 * Class representing the Add button for Tables.
	 *
	 * @author amedrano
	 */
	public class AddTableButton extends JButton implements ActionListener {

		public AddTableButton(Icon icon) {
			super(icon);
			this.addActionListener(this);
			this.setName(fc.getURI() + "_Add");
		}

		public AddTableButton(String text, Icon icon) {
			super(text, icon);
			this.addActionListener(this);
			this.setName(fc.getURI() + "_Add");
		}

		public AddTableButton(String text) {
			super(text);
			this.addActionListener(this);
			this.setName(fc.getURI() + "_Add");
		}

		/**
		 * Java Serializer Variable
		 */
		private static final long serialVersionUID = 1L;

		/**
		 * Constructor for Add button
		 */
		public AddTableButton() {
			super();
			this.addActionListener(this);
			this.setName(fc.getURI() + "_Add");
		}

		/** {@inheritDoc} */
		public void actionPerformed(ActionEvent e) {
File Project Line
org/universAAL/ui/handler/gui/swing/model/FormControl/RepeatModelGrid.java universAAL UI Handler Swing 194
org/universAAL/ui/handler/gui/swing/model/FormControl/RepeatModelTable.java universAAL UI Handler Swing 182
				}
			});
		}
	}

	/**
	 * Class representing the Delete button for Tables.
	 *
	 * @author amedrano
	 */
	public class DeleteTableButton extends JButton implements ActionListener {

		public DeleteTableButton(Icon icon) {
			super(icon);
			this.addActionListener(this);
			this.setName(fc.getURI() + "_Delete");
		}

		public DeleteTableButton(String text, Icon icon) {
			super(text, icon);
			this.addActionListener(this);
			this.setName(fc.getURI() + "_Delete");
		}

		public DeleteTableButton(String text) {
			super(text);
			this.addActionListener(this);
			this.setName(fc.getURI() + "_Delete");
		}

		/**
		 * Java Serializer Variable
		 */
		private static final long serialVersionUID = 1L;

		/**
		 * Constructor for Remove Button
		 */
		public DeleteTableButton() {
			super();
			this.addActionListener(this);
			this.setName(fc.getURI() + "_Delete");
		}

		/** {@inheritDoc} */
		public void actionPerformed(ActionEvent e) {
File Project Line
org/universAAL/ui/gui/swing/bluesteelLAF/GroupLAF.java universAAL UI Handler Swing Look and Feel Bluesteel 102
org/universAAL/ui/handler/gui/swing/defaultLookAndFeel/GroupLAF.java universAAL UI Handler Swing 48
		} else {
			LevelRating complexity = ((Group) fc).getComplexity();
			if (((Group) fc).isRootGroup() || complexity == LevelRating.none) {
				wrap = new GroupPanelLAF((Group) fc, getRenderer());
			}
			if (complexity == LevelRating.low) {
				wrap = new GroupPanelLAF((Group) fc, getRenderer());
			}
			if (complexity == LevelRating.middle) {
				wrap = new GroupPanelLAF((Group) fc, getRenderer());
			}
			if (complexity == LevelRating.high) {
				wrap = new GroupPanelLAF((Group) fc, getRenderer());
			}
			if (complexity == LevelRating.full) {
				wrap = new GroupTabbedPanelLAF((Group) fc, getRenderer());
			}
File Project Line
org/universAAL/ui/gui/swing/bluesteelLAF/GroupPanelLAF.java universAAL UI Handler Swing Look and Feel Bluesteel 89
org/universAAL/ui/handler/gui/swing/classic/GroupLAF.java universAAL UI Handler Swing Look and Feel Classic 96
				layout = new GridUnitLayout(gap, ((GridLayout) r).getColCount());
			}
			if (r.equals(HorizontalAlignment.left)) {
				alignment = FlowLayout.LEFT;
			}
			if (r.equals(HorizontalAlignment.center)) {
				alignment = FlowLayout.CENTER;
			}
			if (r.equals(HorizontalAlignment.right)) {
				alignment = FlowLayout.RIGHT;
			}
			if (r.equals(VerticalAlignment.top)) {
				alignment = VerticalFlowLayout.TOP;
			}
			if (r.equals(VerticalAlignment.middle)) {
				alignment = VerticalFlowLayout.CENTER;
			}
			if (r.equals(VerticalAlignment.bottom)) {
				alignment = VerticalFlowLayout.BOTTOM;
			}
		}
		if (layout instanceof FlowLayout) {
			((FlowLayout) layout).setAlignment(alignment);
			((FlowLayout) layout).setHgap(gap);
File Project Line
org/universAAL/ui/handler/gui/swing/classic/RepeatModelTableLAF.java universAAL UI Handler Swing Look and Feel Classic 78
org/universAAL/ui/handler/gui/swing/defaultLookAndFeel/RepeatModelTableLAF.java universAAL UI Handler Swing 51
		JScrollPane scrollPane = new JScrollPane(table);

		JPanel buttonPanel = getButtonPanel();
		buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.Y_AXIS));
		Component[] buttons = buttonPanel.getComponents();
		for (int i = 0; i < buttons.length; i++) {
			setButtonColors((JButton) buttons[i]);
		}
		JPanel pannelWithAll = new JPanel();
		pannelWithAll.setLayout(new BorderLayout());
		pannelWithAll.add(scrollPane, BorderLayout.CENTER);
		pannelWithAll.add(buttonPanel, BorderLayout.EAST);
		pannelWithAll.add(getRenderer().getModelMapper().getModelFor(fc.getLabel()).getComponent(), BorderLayout.NORTH);
		needsLabel = false;
		return pannelWithAll;
	}

	private void setButtonColors(JButton button) {
File Project Line
org/universAAL/ui/handler/gui/swing/defaultLookAndFeel/RepeatModelGridLAF.java universAAL UI Handler Swing 51
org/universAAL/ui/handler/gui/swing/defaultLookAndFeel/RepeatModelTableLAF.java universAAL UI Handler Swing 51
		JScrollPane scrollPane = new JScrollPane(super.getNewComponent());

		JPanel buttonPanel = getButtonPanel();
		buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.Y_AXIS));
		Component[] buttons = buttonPanel.getComponents();
		for (int i = 0; i < buttons.length; i++) {
			setButtonColors((JButton) buttons[i]);
		}
		JPanel pannelWithAll = new JPanel();
		pannelWithAll.setLayout(new BorderLayout());
		pannelWithAll.add(scrollPane, BorderLayout.CENTER);
		pannelWithAll.add(buttonPanel, BorderLayout.EAST);
		pannelWithAll.add(getRenderer().getModelMapper().getModelFor(fc.getLabel()).getComponent(), BorderLayout.NORTH);
		needsLabel = false;
		return pannelWithAll;
	}
File Project Line
org/universAAL/ui/gui/swing/bluesteelLAF/GroupLAF.java universAAL UI Handler Swing Look and Feel Bluesteel 175
org/universAAL/ui/gui/swing/bluesteelLAF/GroupPanelLAF.java universAAL UI Handler Swing Look and Feel Bluesteel 89
				lm = new GridUnitLayout(gap, ((GridLayout) r).getColCount());
			}
			if (r.equals(HorizontalAlignment.left)) {
				alignment = FlowLayout.LEFT;
			}
			if (r.equals(HorizontalAlignment.center)) {
				alignment = FlowLayout.CENTER;
			}
			if (r.equals(HorizontalAlignment.right)) {
				alignment = FlowLayout.RIGHT;
			}
			if (r.equals(VerticalAlignment.top)) {
				alignment = VerticalFlowLayout.TOP;
			}
			if (r.equals(VerticalAlignment.middle)) {
				alignment = VerticalFlowLayout.CENTER;
			}
			if (r.equals(VerticalAlignment.bottom)) {
				alignment = VerticalFlowLayout.BOTTOM;
			}
		}
		if (lm instanceof FlowLayout) {
File Project Line
org/universAAL/ui/handler/gui/swing/classic/RepeatModelTableLAF.java universAAL UI Handler Swing Look and Feel Classic 78
org/universAAL/ui/handler/gui/swing/defaultLookAndFeel/RepeatModelGridLAF.java universAAL UI Handler Swing 51
		JScrollPane scrollPane = new JScrollPane(table);

		JPanel buttonPanel = getButtonPanel();
		buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.Y_AXIS));
		Component[] buttons = buttonPanel.getComponents();
		for (int i = 0; i < buttons.length; i++) {
			setButtonColors((JButton) buttons[i]);
		}
		JPanel pannelWithAll = new JPanel();
		pannelWithAll.setLayout(new BorderLayout());
		pannelWithAll.add(scrollPane, BorderLayout.CENTER);
		pannelWithAll.add(buttonPanel, BorderLayout.EAST);
		pannelWithAll.add(getRenderer().getModelMapper().getModelFor(fc.getLabel()).getComponent(), BorderLayout.NORTH);
		needsLabel = false;
		return pannelWithAll;
	}
File Project Line
org/universAAL/ui/handler/gui/swing/ResourceMapper.java universAAL UI Handler Swing 82
org/universAAL/ui/handler/web/html/ResourceMapper.java universAAL UI HTML5 Web Handler 146
					LogUtils.logWarn(context, ResourceMapper.class, "search",
							new String[] { "Resource " + url + " not found" }, null);
				return retVal;
			}
		}

	}

	/**
	 * Check that the resource pointed by the URL really exists.
	 *
	 * @param url
	 *            the URL to be checked
	 * @return true is the URL can be accessed
	 */
	static private boolean existsURL(URL url) {
		URLConnection con;
		try {
			con = url.openConnection();
			con.connect();
			con.getInputStream();
			return true;
		} catch (IOException e) {
			return false;
		}
	}

	/**
	 * Searched for the specified url in the config directory.
	 *
	 * @param url
	 *            the relative url of the file to look for.
	 * @return the {@link URL} of the file if found, null otherwise.
	 */
	static private URL searchFolder(String url) {
		int i = 0;
		URL file = null;
		while (i < resourceFolders.length && file == null) {
			file = checkFolder(resourceFolders[i] + url);
			i++;
		}
		return file;
	}

	/**
	 * check whether the specified url exists or not.
	 *
	 * @param url
	 *            the url to test.
	 * @return the {@link URL} of existent file, null otherwise
	 */
	static private URL checkFolder(String url) {
		URL urlFile;
File Project Line
org/universAAL/ui/gui/swing/bluesteelLAF/RepeatModelGridLAF.java universAAL UI Handler Swing Look and Feel Bluesteel 53
org/universAAL/ui/handler/gui/swing/defaultLookAndFeel/RepeatModelGridLAF.java universAAL UI Handler Swing 59
		JPanel pannelWithAll = new JPanel();
		pannelWithAll.setLayout(new BorderLayout());
		pannelWithAll.add(scrollPane, BorderLayout.CENTER);
		pannelWithAll.add(buttonPanel, BorderLayout.EAST);
		pannelWithAll.add(getRenderer().getModelMapper().getModelFor(fc.getLabel()).getComponent(), BorderLayout.NORTH);
		needsLabel = false;
		return pannelWithAll;
	}

	protected JPanel getButtonPanel() {
		Repeat r = (Repeat) fc;

		JPanel buttonPanel = new JPanel();
		if (r.listAcceptsNewEntries()) {
			Icon icon = IconFactory.getIcon("common/Edit/Add.png");
			icon = IconFactory.resizeIcon(icon, AUX_BUTTON_SIZE, AUX_BUTTON_SIZE);
			buttonPanel.add(new RoundedGradientButton(new AddTableButton(icon), AUX_BUTTON_LIGTH, AUX_BUTTON_DARK));
File Project Line
org/universAAL/ui/dm/dialogManagement/DialogPriorityQueue.java universAAL UI Dialog Manager 2.0 129
org/universAAL/ui/dm/dialogManagement/DialogPriorityQueueVerbosity.java universAAL UI Dialog Manager 2.0 160
			activeSet.add(r);
		}
	}

	/** {@inheritDoc} */
	public UIRequest get(String UIReqID) {
		UIRequest r = suspendedSet.get(UIReqID);
		if (r != null) {
			return r;
		} else {
			return getActive(UIReqID);
		}
	}

	/**
	 * scan the active set for a {@link UIRequest} that has an ID corresponding
	 * to UIReqID
	 *
	 * @param UIReqID
	 *            The ID to look for
	 * @return the {@link UIRequest} with UIReqID id, or null if not found
	 */
	private UIRequest getActive(String UIReqID) {
		Iterator<UIRequest> i = activeSet.iterator();
		UIRequest req = null;
		boolean found = false;
		while (!found && i.hasNext()) {
			req = (UIRequest) i.next();
			found = req.getDialogID().equals(UIReqID);
		}
		if (found) {
			return req;
		} else {
			return null;
		}
	}
File Project Line
org/universAAL/ui/gui/swing/bluesteelLAF/GroupLAF.java universAAL UI Handler Swing Look and Feel Bluesteel 175
org/universAAL/ui/handler/gui/swing/classic/GroupLAF.java universAAL UI Handler Swing Look and Feel Classic 96
				lm = new GridUnitLayout(gap, ((GridLayout) r).getColCount());
			}
			if (r.equals(HorizontalAlignment.left)) {
				alignment = FlowLayout.LEFT;
			}
			if (r.equals(HorizontalAlignment.center)) {
				alignment = FlowLayout.CENTER;
			}
			if (r.equals(HorizontalAlignment.right)) {
				alignment = FlowLayout.RIGHT;
			}
			if (r.equals(VerticalAlignment.top)) {
				alignment = VerticalFlowLayout.TOP;
			}
			if (r.equals(VerticalAlignment.middle)) {
				alignment = VerticalFlowLayout.CENTER;
			}
			if (r.equals(VerticalAlignment.bottom)) {
				alignment = VerticalFlowLayout.BOTTOM;
			}
		}
		if (lm instanceof FlowLayout) {
File Project Line
org/universAAL/ui/handler/gui/swing/classic/FormLAF.java universAAL UI Handler Swing Look and Feel Classic 250
org/universAAL/ui/handler/gui/swing/defaultLookAndFeel/FormLAF.java universAAL UI Handler Swing 181
			JScrollPane sub = getSubmitPanelScroll(0, true);
			sub.getAccessibleContext().setAccessibleName(SUB_NAME);
			JScrollPane sys = getSystemPanelScroll();
			sys.getAccessibleContext().setAccessibleName(SYS_NAME);
			JPanel subpanel = new JPanel(new BorderLayout());
			subpanel.add(getIOPanelScroll(), BorderLayout.CENTER);
			for (int i = super.getSubdialogLevel(); i > 1; i--) {
				subpanel.add(getSubmitPanel(i), BorderLayout.EAST);
				JPanel tempanel = new JPanel(new BorderLayout());
				tempanel.add(subpanel, BorderLayout.CENTER);
				subpanel = tempanel;
			}
			frame.add(getHeader(form.getTitle()), BorderLayout.NORTH);
File Project Line
org/universAAL/ui/handler/gui/swing/Renderer.java universAAL UI Handler Swing 538
org/universAAL/ui/handler/web/html/HTMLUserGenerator.java universAAL UI HTML5 Web Handler 199
	}

	/**
	 * Check if impairment is listed as present impairments for the current user
	 * and form.
	 *
	 * @param impariment
	 *            the {@link AccessImpairment} to be checked
	 * @return true is impairment is present in the current Dialog Request.
	 * @see AccessImpairment
	 * @see UIRequest
	 */
	public final boolean hasImpairment(AccessImpairment impariment) {
		AccessImpairment[] imp = fm.getCurrentDialog().getImpairments();
		int i = 0;
		while (i < imp.length && imp[i] != impariment) {
			i++;
		}
		return i != imp.length;
	}

	/**
	 * Get the Language that should be used.
	 *
	 * @return the two-letter representation of the language-
	 */
	public final String getLanguage() {
		return fm.getCurrentDialog().getDialogLanguage().getDisplayVariant();
	}

	/**
	 * Get the {@link FormManager} being used, useful to access the current
	 * UIResquest and current form.
	 *
	 * @return {@link Renderer#fm}
	 */
	public FormManager getFormManagement() {
		return fm;
	}

	/**
	 * Returns the ModelMapper that automatically assigns this Renderer to the
	 * Models.
	 *
	 * @return
	 */
	public final ModelMapper getModelMapper() {
		return modelMapper;
	}

	/**
	 * get the {@link Handler} of this {@link Renderer}.
	 *
	 * @return the {@link Handler}
	 */
	public final Handler getHandler() {
		return handler;
	}

	/**
	 * get the Initial instance when the LAF was loaded.
	 *
	 * @return the initLAF
	 */
	public final InitInterface getInitLAF() {
File Project Line
org/universAAL/ui/handler/gui/swing/classic/SubdialogTriggerLAF.java universAAL UI Handler Swing Look and Feel Classic 61
org/universAAL/ui/handler/gui/swing/classic/SubmitLAF.java universAAL UI Handler Swing Look and Feel Classic 71
		button.setMaximumSize(new Dimension(SubmitLAF.MAX_WIDE, SubmitLAF.MAX_HEIGHT));
		if (fc.getLabel() != null) {
			String txt = fc.getLabel().getText();
			if (txt != null) {
				button.setText("<html><body align=\"center\"> " + txt + " </body>");
			}
		}
		button.addComponentListener(this);
		button.addActionListener(this);
		return button;
	}

	public void componentShown(ComponentEvent e) {
	}

	public void componentResized(ComponentEvent e) {
		if (fc.getLabel() != null && ((AbstractButton) e.getComponent()).getIcon() == null) {
File Project Line
org/universAAL/ui/dm/ui/preferences/caller/helpers/UIPreferencesSubprofilePrerequisitesHelper.java universAAL UI Dialog Manager 2.0 66
org/universAAL/ui/dm/ui/preferences/caller/helpers/UIPreferencesSubprofilePrerequisitesHelper.java universAAL UI Dialog Manager 2.0 121
	public boolean getUserSucceeded(Resource user) {
		ServiceRequest req = new ServiceRequest(new ProfilingService(), null);
		req.addValueFilter(new String[] { ProfilingService.PROP_CONTROLS }, user);
		req.addRequiredOutput(OUTPUT_USER, new String[] { ProfilingService.PROP_CONTROLS });

		ServiceResponse resp = sc.call(req);
		if (resp.getCallStatus() == CallStatus.succeeded) {
			Object out = getReturnValue(resp.getOutputs(), OUTPUT_USER);
			if (out != null) {
				LogUtils.logDebug(mc, this.getClass(), "getUserSucceeded",
File Project Line
org/universAAL/ui/handler/gui/swing/model/FormControl/SelectModel.java universAAL UI Handler Swing 118
org/universAAL/ui/handler/web/html/model/SelectModel.java universAAL UI HTML5 Web Handler 68
		Object val = ((Select) fc).getValue();
		if (val instanceof List) {
			selected = new ArrayList((List) val);
		} else if (val instanceof Object[]) {
			selected = new ArrayList();
			for (int i = 0; i < ((Object[]) val).length; i++) {
				selected.add(((Object[]) val)[i]);
			}
		} else {
			selected = new ArrayList();
			if (val != null) {
				selected.add(val);
			}
		}