===================================================================== Found a 49 line (331 tokens) duplication in the following files: Starting at line 551 of /home/tom/pmd/pmd-web/src/source/net/sourceforge/toscanaj/view/database/DatabaseConnectionInformationView.java Starting at line 648 of /home/tom/pmd/pmd-web/src/source/net/sourceforge/toscanaj/view/database/DatabaseConnectionInformationView.java this.add(new JLabel("Excel Workbook Location: "),new GridBagConstraints( 0,0,1,1,0,0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 0), 2,2)); this.add(fileUrlField,new GridBagConstraints( 0,1,1,1,1,0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 15, 5, 0), 2,2)); this.add(fileButton,new GridBagConstraints( 0,2,1,1,0,0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 2,2)); this.add(new JLabel("Username: "),new GridBagConstraints( 0,3,1,1,0,0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 2,2)); this.add(userNameField,new GridBagConstraints( 0,4,1,1,1,0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 15, 5, 5), 2,2)); this.add(new JLabel("Password: "),new GridBagConstraints( 0,5,1,1,0,0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 2,2)); this.add(passwordField,new GridBagConstraints( 0,6,1,1,10,0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 15, 5, 5), 2,2)); this.add(new JLabel("Note: this works only with Excel files having named ranges"), ===================================================================== Found a 37 line (271 tokens) duplication in the following files: Starting at line 91 of /home/tom/pmd/pmd-web/src/source/net/sourceforge/toscanaj/view/context/ContextTableRowHeader.java Starting at line 84 of /home/tom/pmd/pmd-web/src/source/net/sourceforge/toscanaj/view/context/ContextTableColumnHeader.java } protected void drawCell(Graphics2D g2d, String content, int x, int y) { g2d.fill(new Rectangle2D.Double(x, y, ContextTableView.CELL_WIDTH, ContextTableView.CELL_HEIGHT)); Paint oldPaint = g2d.getPaint(); g2d.setPaint(ContextTableView.TEXT_COLOR); g2d.draw(new Rectangle2D.Double(x, y, ContextTableView.CELL_WIDTH, ContextTableView.CELL_HEIGHT)); FontMetrics fontMetrics = g2d.getFontMetrics(); String newContent = reduceStringDisplayWidth(content, g2d); g2d.drawString( newContent, x + ContextTableView.CELL_WIDTH / 2 - fontMetrics.stringWidth(newContent) / 2, y + ContextTableView.CELL_HEIGHT / 2 + fontMetrics.getMaxAscent() / 2); g2d.setPaint(oldPaint); } protected String reduceStringDisplayWidth(String content, Graphics2D g2d) { String newContent = content; String tail = "..."; int stringWidth = g2d.getFontMetrics().stringWidth(newContent); int tailWidth = g2d.getFontMetrics().stringWidth(tail); if (stringWidth > (ContextTableView.CELL_WIDTH - 10)) { while ((stringWidth + tailWidth) > (ContextTableView.CELL_WIDTH - 10)) { newContent = newContent.substring(0, (newContent.length() - 1)); stringWidth = g2d.getFontMetrics().stringWidth(newContent); } newContent += tail; } return newContent; } public String getToolTipText(MouseEvent e) { String tooltipText = null; ContextTableView.Position pos = this.dialog.getTablePosition(e.getX(), e.getY()); ===================================================================== Found a 39 line (268 tokens) duplication in the following files: Starting at line 193 of /home/tom/pmd/pmd-web/src/source/net/sourceforge/toscanaj/view/diagram/DiagramSchema.java Starting at line 271 of /home/tom/pmd/pmd-web/src/source/net/sourceforge/toscanaj/view/diagram/DiagramSchema.java schema.topColor = new Color(0, 0, 0); schema.bottomColor = new Color(255, 255, 255); schema.gradient = schema.getDefaultGradient(); schema.foreground = new Color(0, 0, 0); schema.nestedDiagramNodeColor = new Color(255, 255, 255); schema.notRealisedDiagramNodeColor = null; schema.circleColor = new Color(0, 0, 0); schema.lineColor = new Color(0, 0, 0); schema.circleSelectionColor = new Color(128,128,128); schema.circleIdealColor = new Color(0, 0, 0); schema.circleFilterColor = new Color(0, 0, 0); schema.fadeOut = 0.7F; schema.margin = 20; schema.notRealizedNodeSizeReductionFactor = 3; schema.gradientType = ConceptInterpreter.INTERVAL_TYPE_EXTENT; schema.defaultLineWidth = 1; schema.selectionLineWidth = 3; schema.labelFont = new Font("SansSerif", Font.PLAIN, 10); schema.nodeSizeScalingType = ConceptInterpreter.INTERVAL_TYPE_FIXED; /** @todo adjust arrow styles **/ schema.arrowStyles = new ArrowStyle[] { new ArrowStyle(Color.RED), new ArrowStyle(Color.BLUE), new ArrowStyle(Color.GREEN), new ArrowStyle(Color.CYAN), new ArrowStyle(Color.GRAY), new ArrowStyle(Color.MAGENTA), new ArrowStyle(Color.ORANGE), new ArrowStyle(Color.PINK), new ArrowStyle(Color.BLACK), new ArrowStyle(Color.YELLOW) }; return schema; } /** * @todo the default values are duplicated in the restore(ExtendedPreferences) method -- remove */ private static DiagramSchema getDefaultSchema() { ===================================================================== Found a 35 line (255 tokens) duplication in the following files: Starting at line 194 of /home/tom/pmd/pmd-web/src/source/net/sourceforge/toscanaj/view/diagram/DiagramSchema.java Starting at line 233 of /home/tom/pmd/pmd-web/src/source/net/sourceforge/toscanaj/view/diagram/DiagramSchema.java schema.bottomColor = new Color(0, 0, 0); schema.gradient = schema.getDefaultGradient(); schema.foreground = new Color(0, 0, 0); schema.nestedDiagramNodeColor = new Color(255, 255, 255); schema.notRealisedDiagramNodeColor = null; schema.circleColor = new Color(0, 0, 0); schema.lineColor = new Color(0, 0, 0); schema.circleSelectionColor = new Color(128,128,128); schema.circleIdealColor = new Color(0, 0, 0); schema.circleFilterColor = new Color(0, 0, 0); schema.fadeOut = 0.7F; schema.margin = 20; schema.notRealizedNodeSizeReductionFactor = 3; schema.gradientType = ConceptInterpreter.INTERVAL_TYPE_EXTENT; schema.defaultLineWidth = 1; schema.selectionLineWidth = 3; schema.labelFont = new Font("SansSerif", Font.PLAIN, 10); schema.nodeSizeScalingType = ConceptInterpreter.INTERVAL_TYPE_FIXED; /** @todo adjust arrow styles **/ schema.arrowStyles = new ArrowStyle[] { new ArrowStyle(Color.RED), new ArrowStyle(Color.BLUE), new ArrowStyle(Color.GREEN), new ArrowStyle(Color.CYAN), new ArrowStyle(Color.GRAY), new ArrowStyle(Color.MAGENTA), new ArrowStyle(Color.ORANGE), new ArrowStyle(Color.PINK), new ArrowStyle(Color.BLACK), new ArrowStyle(Color.YELLOW) }; return schema; } private static DiagramSchema getGrayscaleSchema() { ===================================================================== Found a 60 line (234 tokens) duplication in the following files: Starting at line 980 of /home/tom/pmd/pmd-web/src/source/net/sourceforge/toscanaj/gui/SienaMainPanel.java Starting at line 1080 of /home/tom/pmd/pmd-web/src/source/net/sourceforge/toscanaj/gui/SienaMainPanel.java openDialog = new JFileChooser(this.lastOALFile); } else { openDialog = new JFileChooser(System.getProperty("user.dir")); } openDialog.setMultiSelectionEnabled(true); // create the options panel to be used in the file chooser JRadioButton keepSchemaButton = new JRadioButton("Extend existing schema"); keepSchemaButton.setSelected(true); JRadioButton newSchemaButton = new JRadioButton("Create new schema"); ButtonGroup schemaOptionGroup = new ButtonGroup(); schemaOptionGroup.add(keepSchemaButton); schemaOptionGroup.add(newSchemaButton); JPanel schemaOptionPanel = new JPanel(new GridBagLayout()); schemaOptionPanel.add( keepSchemaButton, new GridBagConstraints( 0, 0, 1, 1, 1, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 2, 2)); schemaOptionPanel.add( newSchemaButton, new GridBagConstraints( 0, 1, 1, 1, 1, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 2, 2)); schemaOptionPanel.add( new JPanel(), new GridBagConstraints( 0, 2, 1, 1, 1, 1, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(0, 5, 5, 5), 2, 2)); openDialog.setAccessory(schemaOptionPanel); openDialog.setFileFilter( new ExtensionFileFilter(new String[] { "oal" }, "Object Attribute Lists")); ===================================================================== Found a 35 line (209 tokens) duplication in the following files: Starting at line 590 of /home/tom/pmd/pmd-web/src/source/net/sourceforge/toscanaj/gui/ElbaMainPanel.java Starting at line 736 of /home/tom/pmd/pmd-web/src/source/net/sourceforge/toscanaj/gui/SienaMainPanel.java viewMenu.addSeparator(); ButtonGroup fontSizeGroup = new ButtonGroup(); JMenu setMinLabelSizeSubMenu = new JMenu("Set minimum label size"); setMinLabelSizeSubMenu.setMnemonic(KeyEvent.VK_S); JMenuItem fontRangeMenuItem = new JRadioButtonMenuItem("None"); fontSizeGroup.add(fontRangeMenuItem); fontRangeMenuItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JMenuItem source = (JMenuItem) e.getSource(); diagramView.setMinimumFontSize(0); source.setSelected(true); } }); fontRangeMenuItem.setSelected(true); setMinLabelSizeSubMenu.add(fontRangeMenuItem); int fontRange = 6; //min font size while (fontRange < 26) { fontRangeMenuItem = new JRadioButtonMenuItem(fontRange + ""); fontSizeGroup.add(fontRangeMenuItem); fontRangeMenuItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JMenuItem source = (JMenuItem) e.getSource(); int newFontSize = Integer.parseInt(source.getText()); diagramView.setMinimumFontSize(newFontSize); source.setSelected(true); } }); if (diagramView.getMinimumFontSize() == fontRange) { fontRangeMenuItem.setSelected(true); } fontRange += 2; setMinLabelSizeSubMenu.add(fontRangeMenuItem); } viewMenu.add(setMinLabelSizeSubMenu); ===================================================================== Found a 34 line (179 tokens) duplication in the following files: Starting at line 799 of /home/tom/pmd/pmd-web/src/source/net/sourceforge/toscanaj/gui/ElbaMainPanel.java Starting at line 1335 of /home/tom/pmd/pmd-web/src/source/net/sourceforge/toscanaj/gui/SienaMainPanel.java setTitle(WINDOW_TITLE); } } private void recreateMruMenu() { if (this.mruMenu == null) { // no menu yet return; } this.mruMenu.removeAll(); boolean empty = true; // will be used to check if we have at least one entry if (this.mruList.size() > 0) { ListIterator it = this.mruList.listIterator(this.mruList.size()); while (it.hasPrevious()) { String cur = (String) it.previous(); if (this.currentFile != null && cur.equals(this.currentFile.getAbsolutePath())) { // don't enlist the current file continue; } empty = false; JMenuItem mruItem = new JMenuItem(cur); mruItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JMenuItem menuItem = (JMenuItem) e.getSource(); openSchemaFile(new File(menuItem.getText())); } }); this.mruMenu.add(mruItem); } } // we have now at least one file this.mruMenu.setEnabled(!empty); } ===================================================================== Found a 49 line (177 tokens) duplication in the following files: Starting at line 423 of /home/tom/pmd/pmd-web/src/source/net/sourceforge/toscanaj/view/context/ContextTableEditorDialog.java Starting at line 207 of /home/tom/pmd/pmd-web/src/source/net/sourceforge/toscanaj/view/scales/AttributeListScaleGeneratorDialog.java scaleTitleField.addKeyListener( new KeyAdapter(){ private void validateTextField(){ if(scaleTitleField.getText().trim().equals("")){ createButton.setEnabled(false); }else{ createButton.setEnabled(true); } } public void keyTyped(KeyEvent e) { validateTextField(); setCreateButtonStatus(); } public void keyReleased(KeyEvent e) { validateTextField(); setCreateButtonStatus(); } }); titlePane.add( titleLabel, new GridBagConstraints( 0, 0, 1, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); titlePane.add( scaleTitleField, new GridBagConstraints( 1, 0, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); } private void createTableButtonsPane(){ ===================================================================== Found a 39 line (151 tokens) duplication in the following files: Starting at line 132 of /home/tom/pmd/pmd-web/src/source/net/sourceforge/toscanaj/view/context/ContextTableRowHeader.java Starting at line 125 of /home/tom/pmd/pmd-web/src/source/net/sourceforge/toscanaj/view/context/ContextTableColumnHeader.java tooltipText = attr.toString(); } } return tooltipText; } public Dimension getPreferredScrollableViewportSize() { return ContextTableView.TABLE_HEADER_PREFERRED_VIEWPORT_SIZE; } public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { if(orientation == SwingConstants.HORIZONTAL) { return ContextTableView.CELL_WIDTH; } else { return ContextTableView.CELL_HEIGHT; } } public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction) { // round the size in any direction down to a multiple of the cell size if(orientation == SwingConstants.HORIZONTAL) { return (visibleRect.width / ContextTableView.CELL_WIDTH) * ContextTableView.CELL_WIDTH; } else { return (visibleRect.height / ContextTableView.CELL_HEIGHT) * ContextTableView.CELL_HEIGHT; } } public boolean getScrollableTracksViewportWidth() { return false; } public boolean getScrollableTracksViewportHeight() { return false; } public void updateSize() { this.setPreferredSize(calculateNewSize()); invalidate(); repaint(); } ===================================================================== Found a 34 line (146 tokens) duplication in the following files: Starting at line 770 of /home/tom/pmd/pmd-web/src/source/net/sourceforge/toscanaj/gui/ElbaMainPanel.java Starting at line 1372 of /home/tom/pmd/pmd-web/src/source/net/sourceforge/toscanaj/gui/SienaMainPanel.java this.conceptualSchema = CSXParser.parse(this.eventBroker, schemaFile); } catch (FileNotFoundException e) { ErrorDialog.showError( this, e, "Could not find file", e.getMessage()); this.conceptualSchema = new ConceptualSchema(this.eventBroker); } catch (IOException e) { ErrorDialog.showError( this, e, "Could not open file", e.getMessage()); this.conceptualSchema = new ConceptualSchema(this.eventBroker); } catch (DataFormatException e) { ErrorDialog.showError( this, e, "Could not read file", e.getMessage()); this.conceptualSchema = new ConceptualSchema(this.eventBroker); } catch (Exception e) { ErrorDialog.showError( this, e, "Could not open file", e.getMessage()); e.printStackTrace(); this.conceptualSchema = new ConceptualSchema(this.eventBroker); } } private WritableManyValuedContext createManyValuedContextFromDiagrams() { ===================================================================== Found a 29 line (129 tokens) duplication in the following files: Starting at line 474 of /home/tom/pmd/pmd-web/src/source/net/sourceforge/toscanaj/gui/ElbaMainPanel.java Starting at line 483 of /home/tom/pmd/pmd-web/src/source/net/sourceforge/toscanaj/gui/SienaMainPanel.java } }); SimpleAction newAction = new SimpleAction( this, newSchemaActivity, "New", KeyEvent.VK_N, KeyStroke.getKeyStroke(KeyEvent.VK_N, ActionEvent.CTRL_MASK)); JMenuItem newMenuItem = new JMenuItem("New"); newMenuItem.setMnemonic(KeyEvent.VK_N); newMenuItem.addActionListener(newAction); this.fileMenu.add(newMenuItem); // @todo check why this code doesn't use openSchema(File) LoadConceptualSchemaActivity loadSchemaActivity = new LoadConceptualSchemaActivity(this.eventBroker); loadSchemaActivity.setTestOpenOkActivity(testSchemaSavedActivity); OpenFileAction openFileAction = new OpenFileAction( this, loadSchemaActivity, this.currentFile, KeyEvent.VK_O, KeyStroke.getKeyStroke(KeyEvent.VK_O, ActionEvent.CTRL_MASK)); openFileAction.addPostOpenActivity(new SimpleActivity() { public boolean doActivity() throws Exception { updateWindowTitle(); ===================================================================== Found a 19 line (129 tokens) duplication in the following files: Starting at line 168 of /home/tom/pmd/pmd-web/src/source/net/sourceforge/toscanaj/view/temporal/TransitionArrow.java Starting at line 42 of /home/tom/pmd/pmd-web/src/source/net/sourceforge/toscanaj/view/temporal/InterSequenceTransitionArrow.java } protected Paint calculatePaint(float arrowLength, Color baseColor) { AnimationTimeController controller = this.timeController; double timeOffset = controller.getCurrentTime() - this.timePos; double alpha = 0; if(timeOffset < - controller.getFadeInTime()) { return null; } else if(timeOffset < 0) { alpha = 1 + timeOffset / controller.getFadeInTime(); } else if(timeOffset < controller.getVisibleTime()) { alpha = 1; } else if(timeOffset < controller.getVisibleTime() + controller.getFadeOutTime()) { alpha = 1 - (timeOffset - controller.getVisibleTime()) / controller.getFadeOutTime(); } else { return null; } Color finalStartColor = new Color(baseColor.getRed(), baseColor.getGreen(), baseColor.getBlue(), ===================================================================== Found a 27 line (128 tokens) duplication in the following files: Starting at line 230 of /home/tom/pmd/pmd-web/src/source/net/sourceforge/toscanaj/view/context/ContextTableRowHeader.java Starting at line 252 of /home/tom/pmd/pmd-web/src/source/net/sourceforge/toscanaj/view/context/ContextTableColumnHeader.java popupMenu.show(dialog.getScrollPane(), e.getX() + getX() + ContextTableView.CELL_WIDTH, e.getY() + getY()); } public void mouseReleased(MouseEvent e) { if (e.isPopupTrigger()) { final ContextTableView.Position pos = dialog.getTablePosition(e.getX(), e.getY()); if (pos == null) { return; } else { showPopupMenu(e, pos); } } } public void mouseClicked(MouseEvent e) { final ContextTableView.Position pos = dialog.getTablePosition(e.getX(), e.getY()); if (pos == null) { return; } if (e.getButton() != MouseEvent.BUTTON1) { return; } if (e.getClickCount() != 2) { return; } ===================================================================== Found a 24 line (127 tokens) duplication in the following files: Starting at line 32 of /home/tom/pmd/pmd-web/src/source/net/sourceforge/toscanaj/controller/diagram/AttributeLabelViewPopupMenuHandler.java Starting at line 29 of /home/tom/pmd/pmd-web/src/source/net/sourceforge/toscanaj/controller/diagram/AttributeEditingLabelViewPopupMenuHandler.java public AttributeEditingLabelViewPopupMenuHandler(DiagramView diagramView, EventBroker schemaBroker) { this.diagramView = diagramView; } public void processEvent(Event e) { CanvasItemEventWithPosition itemEvent = null; try { itemEvent = (CanvasItemEventWithPosition) e; } catch (ClassCastException e1) { throw new RuntimeException(getClass().getName() + " has to be subscribed to CanvasItemEventWithPositions only"); } AttributeLabelView labelView = null; try { labelView = (AttributeLabelView) itemEvent.getItem(); } catch (ClassCastException e1) { throw new RuntimeException(getClass().getName() + " has to be subscribed to events from ObjectLabelViews only"); } openPopupMenu(labelView, itemEvent.getCanvasPosition(), itemEvent.getAWTPosition()); } public void openPopupMenu(final AttributeLabelView labelView, Point2D canvasPosition, Point2D screenPosition) { final WritableFCAElement attribute = (WritableFCAElement) labelView.getEntryAtPosition(canvasPosition); ===================================================================== Found a 23 line (121 tokens) duplication in the following files: Starting at line 623 of /home/tom/pmd/pmd-web/src/source/net/sourceforge/toscanaj/gui/ElbaMainPanel.java Starting at line 700 of /home/tom/pmd/pmd-web/src/source/net/sourceforge/toscanaj/gui/SienaMainPanel.java viewMenu.addSeparator(); final JCheckBoxMenuItem showAttributeLabels = new JCheckBoxMenuItem("Show Attribute Labels"); showAttributeLabels.setMnemonic(KeyEvent.VK_A); showAttributeLabels.setSelected(true); showAttributeLabels.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { boolean newState = !AttributeLabelView.allAreHidden(); showAttributeLabels.setSelected(!newState); AttributeLabelView.setAllHidden(newState); diagramView.repaint(); } }); viewMenu.add(showAttributeLabels); final JCheckBoxMenuItem showObjectLabels = new JCheckBoxMenuItem("Show Object Labels"); showObjectLabels.setMnemonic(KeyEvent.VK_O); showObjectLabels.setSelected(true); showObjectLabels.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { boolean newState = !ObjectLabelView.allAreHidden(); ===================================================================== Found a 15 line (118 tokens) duplication in the following files: Starting at line 170 of /home/tom/pmd/pmd-web/src/source/net/sourceforge/toscanaj/view/temporal/TransitionArrow.java Starting at line 71 of /home/tom/pmd/pmd-web/src/source/net/sourceforge/toscanaj/view/temporal/StateRing.java private Paint calculatePaint() { AnimationTimeController controller = this.timeController; double timeOffset = controller.getCurrentTime() - this.timePos; double alpha = 0; if(timeOffset < - controller.getFadeInTime()) { return null; } else if(timeOffset < 0) { alpha = 1 + timeOffset / controller.getFadeInTime(); } else if(timeOffset < controller.getVisibleTime()) { alpha = 1; } else if(timeOffset < controller.getVisibleTime() + controller.getFadeOutTime()) { alpha = 1 - (timeOffset - controller.getVisibleTime()) / controller.getFadeOutTime(); } else { return null; } ===================================================================== Found a 25 line (117 tokens) duplication in the following files: Starting at line 34 of /home/tom/pmd/pmd-web/src/source/net/sourceforge/toscanaj/model/database/DistinctListQuery.java Starting at line 36 of /home/tom/pmd/pmd-web/src/source/net/sourceforge/toscanaj/model/database/ListQuery.java return "SELECT " + info.getKey().getSqlExpression() + ", " + getFieldList() + " FROM " + info.getTable().getSqlExpression() + " "; } public String getOrderClause() { return "ORDER BY " + getFieldList(); } private String getFieldList() { String retVal = ""; Iterator it = fieldList.iterator(); while (it.hasNext()) { QueryField field = (QueryField) it.next(); retVal += field.getQueryPart(); if (it.hasNext()) { retVal += ", "; } } return retVal; } public DatabaseRetrievedObject createDatabaseRetrievedObject(String whereClause, Vector values, Vector referenceValues) { String displayString = this.formatResults(values, 1); ===================================================================== Found a 16 line (114 tokens) duplication in the following files: Starting at line 210 of /home/tom/pmd/pmd-web/src/source/net/sourceforge/toscanaj/view/diagram/DiagramSchema.java Starting at line 331 of /home/tom/pmd/pmd-web/src/source/net/sourceforge/toscanaj/view/diagram/DiagramSchema.java schema.labelFont = new Font("SansSerif", Font.PLAIN, 10); schema.nodeSizeScalingType = ConceptInterpreter.INTERVAL_TYPE_FIXED; schema.arrowStyles = new ArrowStyle[] { new ArrowStyle(Color.RED), new ArrowStyle(Color.BLUE), new ArrowStyle(Color.GREEN), new ArrowStyle(Color.CYAN), new ArrowStyle(Color.GRAY), new ArrowStyle(Color.MAGENTA), new ArrowStyle(Color.ORANGE), new ArrowStyle(Color.PINK), new ArrowStyle(Color.BLACK), new ArrowStyle(Color.YELLOW) }; return schema; } ===================================================================== Found a 20 line (112 tokens) duplication in the following files: Starting at line 87 of /home/tom/pmd/pmd-web/src/source/net/sourceforge/toscanaj/view/scales/CrossordinalScaleEditorDialog.java Starting at line 85 of /home/tom/pmd/pmd-web/src/source/net/sourceforge/toscanaj/view/scales/OrdinalScaleEditorDialog.java mainPane.add(makeSelectionPane(), new GridBagConstraints( 0,1,1,1,1,1, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(2,2,2,2), 2,2 )); mainPane.add(makeButtonsPane(), new GridBagConstraints( 0,2,1,1,1.0,0, GridBagConstraints.NORTHWEST, GridBagConstraints .HORIZONTAL, new Insets(2,2,2,2), 2,2 )); setContentPane(mainPane); } private JPanel makeTitlePane() { this.titleEditor.addKeyListener(new KeyAdapter(){ ===================================================================== Found a 22 line (108 tokens) duplication in the following files: Starting at line 18 of /home/tom/pmd/pmd-web/src/source/net/sourceforge/toscanaj/model/sql/AndExpression.java Starting at line 18 of /home/tom/pmd/pmd-web/src/source/net/sourceforge/toscanaj/model/sql/OrExpression.java public OrExpression() { // nothing to do here } public void addClause(Expression clause) { subexpressions.add(clause); } public void removeClause(Expression clause) { subexpressions.remove(clause); } public String getSQL() { if(subexpressions.size() == 0) { return "*"; } String retVal = ""; for (Iterator iterator = subexpressions.iterator(); iterator.hasNext();) { Expression expression = (Expression) iterator.next(); retVal += "(" + expression.getSQL() + ")"; if(iterator.hasNext()) { retVal += " OR "; ===================================================================== Found a 27 line (107 tokens) duplication in the following files: Starting at line 422 of /home/tom/pmd/pmd-web/src/source/net/sourceforge/toscanaj/controller/db/DatabaseConnection.java Starting at line 453 of /home/tom/pmd/pmd-web/src/source/net/sourceforge/toscanaj/controller/db/DatabaseConnection.java ResultSet rs = dmd.getTables(null, null, null, viewTypes); while (rs.next()) { result.add(rs.getString(3)); } } catch (SQLException ex) { System.err.println("\n--- SQLException caught ---\n"); while (ex != null) { System.err.println("Message: " + ex.getMessage()); System.err.println("SQLState: " + ex.getSQLState()); System.err.println("ErrorCode: " + ex.getErrorCode()); ex = ex.getNextException(); System.err.println(); } } return result; } /** * Returns a list of column objects. * * The parameter view can be either a table or a view. */ public Vector getColumns(Table table) {