/** * Returns the message at row i. * @param i The row with the message. * @return The message at row i. */ public Message getMessage(int i) { return messages == null || i < 0 || i >= messages.size() ? null : (Message)messages.get(i); }
/** * Return the component for a given x- and y-coordinate. * * @param x The x-coordinate. * @param y The y-coordinate. * @return The component or <code>null</code> if there is no component at the * given point. */ public Component getComponent(int x, int y) { int x1, x2; int y1 = DiagramConstants.yOffsetComponentbox; int y2 = y1 + DiagramConstants.heightComponentbox; for (int i = 0; i < panelcan.visible_components.size(); i++) { Component component = (Component) panelcan.visible_components.get(i); x1 = DiagramConstants.yOffsetComponentbox + i * DiagramConstants.xDistTimeline; x2 = x1 + DiagramConstants.widthComponentbox; if ((x >= x1) && (x <= x2) && (y >= y1) && (y <= y2)) { return component; } } return null; }
/** * Insert an element into the list. * @param index The index where to start insertion. * @param obj The element to insert. * @return The index where the element was actually inserted. */ public int insertElement(int index, T obj) { while(index>0 && compare(get(index-1), obj)>0) { index--; } while(index<size() && compare(get(index), obj)<0) { index++; } super.add(index, obj); return index; }
/** * Returns the value for the cell at <code>columnIndex</code> and * <code>rowIndex</code>. * * @param rowIndex the row whose value is to be queried * @param columnIndex the column whose value is to be queried * @return the value Object at the specified cell */ public Object getValueAt(int rowIndex, int columnIndex) { if(messages == null || rowIndex < 0 || rowIndex >= messages.size()) { return null; } Message me = (Message)messages.get(rowIndex); ColumnHeader header = (ColumnHeader)COLUMN_HEADERS.get(columnIndex); return me.getParameter(header.getParamName()); }
Component component = (Component) panelcan.visible_components.get(i);