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

Duplications

File Project Line
jp/sourceforge/tmdmaker/ui/editor/gef3/editparts/node/AbstractModelEditPart.java TMD-Maker Plugin 217
jp/sourceforge/tmdmaker/ui/editor/gef3/treeeditparts/AbstractEntityModelTreeEditPart.java TMD-Maker Plugin 247
		return getModel().getModelTargetConnections();
	}

	/**
	 * 
	 * {@inheritDoc}
	 * 
	 * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
	 */
	@Override
	public void propertyChange(PropertyChangeEvent evt) {
		logger.debug("{}.{}", getClass(), evt.getPropertyName());

		if (evt.getPropertyName().equals(ModelElement.PROPERTY_NAME)) {
			handleNameChange(evt);
		} else if (evt.getPropertyName().equals(ModelElement.PROPERTY_CONSTRAINT)) {
			handleConstraintChange(evt);
		} else if (evt.getPropertyName().equals(AbstractEntityModel.PROPERTY_ATTRIBUTE)) {
			handleAttributeChange(evt);
		} else if (evt.getPropertyName().equals(ConnectableElement.P_SOURCE_CONNECTION)) {
			handleSourceConnectionChange(evt);
		} else if (evt.getPropertyName().equals(ConnectableElement.P_TARGET_CONNECTION)) {
			handleTargetConnectionChange(evt);
		} else if (evt.getPropertyName().equals(AbstractEntityModel.PROPERTY_REUSED)) {
			handleReUseKeyChange(evt);
		} else if (evt.getPropertyName().equals(AbstractEntityModel.PROPERTY_IDENTIFIER)) {
			handleIdentifierChange(evt);
		} else if (evt.getPropertyName().equals(AbstractEntityModel.PROPERTY_ATTRIBUTE_REORDER)) {
			logger.warn("Handle Reorder Occured.");
			refreshChildren();
		} else {
			logger.warn("Not Handle Event Occured.");
		}
	}

	/**
	 * 名称変更イベント処理
	 * 
	 * @param evt
	 *            発生したイベント情報
	 */
	protected void handleNameChange(PropertyChangeEvent evt) {
		refreshVisuals();
	}

	/**
	 * 制約変更イベント処理
	 * 
	 * @param evt
	 *            発生したイベント情報
	 */
	protected void handleConstraintChange(PropertyChangeEvent evt) {
		refreshVisuals();
	}

	/**
	 * 属性変更イベント処理
	 * 
	 * @param evt
	 *            発生したイベント情報
	 */
	protected void handleAttributeChange(PropertyChangeEvent evt) {
		refreshVisuals();
		refreshChildren();
	}

	/**
	 * 個体指定子変更イベント処理
	 * 
	 * @param evt
	 *            発生したイベント情報
	 */
	protected void handleIdentifierChange(PropertyChangeEvent evt) {
		refreshVisuals();
	}

	/**
	 * 接続元コネクション変更イベント処理
	 * 
	 * @param evt
	 *            発生したイベント情報
	 */
	protected void handleSourceConnectionChange(PropertyChangeEvent evt) {
File Project Line
jp/sourceforge/tmdmaker/model/VirtualSupersetTest.java TMD-Maker Core Test Plugin 125
jp/sourceforge/tmdmaker/model/VirtualSupersetTest.java TMD-Maker Core Test Plugin 156
	public void testEditSuperSuper1() {
		List<AbstractEntityModel> list = new ArrayList<AbstractEntityModel>();
		Diagram diagram = new Diagram();
		Entity e1 = Entity.ofEvent(new Identifier("テスト1番号")).withDefaultAttribute();
		diagram.addChild(e1);
		Entity e2 = Entity.ofEvent(new Identifier("テスト2番号")).withDefaultAttribute();
		diagram.addChild(e2);
		Entity e3 = Entity.ofEvent(new Identifier("テスト2番号")).withDefaultAttribute();
		diagram.addChild(e3);
		VirtualSuperset vsp1 = VirtualSuperset.of(new ModelName("スーパーセット"));
		VirtualSubsetBuilder builder = vsp1.virtualSubsets().builder();
		list.add(e1);
		list.add(e2);
		list.add(e3);
		builder.subsetList(list).build();
		assertEquals(3, vsp1.virtualSubsets().all().size());

		List<AbstractEntityModel> list2 = new ArrayList<AbstractEntityModel>();
		list2.add(e1);
		list2.add(e2);
		builder = vsp1.virtualSubsets().builder();
		builder.subsetList(list2).build();
File Project Line
jp/sourceforge/tmdmaker/ui/dialogs/MultivalueAndSupersetEditDialog.java TMD-Maker Plugin 58
jp/sourceforge/tmdmaker/ui/dialogs/SupersetEditDialog.java TMD-Maker Plugin 58
	public MultivalueAndSupersetEditDialog(Shell parentShell, AbstractEntityModel original) {
		super(parentShell);
		entity = new EditTable(original);
		entity.addPropertyChangeListener(this);
	}

	/**
	 * 
	 * {@inheritDoc}
	 * 
	 * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
	 */
	@Override
	public void propertyChange(PropertyChangeEvent arg0) {
		// do nothing
	}

	/**
	 * {@inheritDoc}
	 * 
	 * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
	 */
	@Override
	protected Control createDialogArea(Composite parent) {
		getShell().setText(Messages.EditVirtualSuperset);

		Composite composite = new Composite(parent, SWT.NULL);
		composite.setLayout(new GridLayout(2, false));
		GridData gridData = new GridData(GridData.FILL_BOTH);
		composite.setLayoutData(gridData);
		Label label = new Label(composite, SWT.NULL);
		label.setText(Messages.ModelName);
		inputNameText = new Text(composite, SWT.BORDER);
		inputNameText.setText(entity.getName());
		inputNameText.addModifyListener(new ModifyListener() {
			@Override
			public void modifyText(ModifyEvent e) {
				entity.setName(inputNameText.getText());
			}
		});
		gridData_1 = new GridData(GridData.FILL_BOTH);
		gridData_1.grabExcessVerticalSpace = false;
		gridData_1.widthHint = 200;
File Project Line
jp/sourceforge/tmdmaker/ui/preferences/appearance/ColorAppearancePreferencePage.java TMD-Maker Plugin 60
jp/sourceforge/tmdmaker/ui/preferences/appearance/FontAppearancePreferencePage.java TMD-Maker Plugin 60
	public ColorAppearancePreferencePage() {
		super(GRID);
		setPreferenceStore(TMDPlugin.getDefault().getPreferenceStore());
		getPreferenceStore().addPropertyChangeListener(listener);
	}

	/**
	 * 
	 * {@inheritDoc}
	 * 
	 * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
	 */
	@Override
	public void init(IWorkbench workbench) {
		// do nothing
	}

	/**
	 * {@inheritDoc}
	 * 
	 * @see org.eclipse.jface.preference.FieldEditorPreferencePage#initialize()
	 */
	@Override
	protected void initialize() {
		super.initialize();
		setColorFieldsEnabled(getPreferenceStore()
				.getBoolean(AppearancePreferenceConstants.P_ENTITY_COLOR_ENABLED));
	}

	/**
	 * 
	 * {@inheritDoc}
	 * 
	 * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
	 */
	@Override
	protected void createFieldEditors() {
		Composite parent = getFieldEditorParent();
		Group colorGroup = new Group(parent, SWT.NONE);
		colorGroup.setText(Messages.ColorSettings);
		colorGroup.setLayout(new GridLayout(1, true));

		colorFields = new Composite(colorGroup, SWT.NONE);
		new Label(colorFields, SWT.NONE);
		Label l = new Label(colorFields, SWT.NONE);
		l.setText(Messages.BackgroundColors);
File Project Line
jp/sourceforge/tmdmaker/ui/editor/gef3/editpolicies/SubsetEntityComponentEditPolicy.java TMD-Maker Plugin 43
jp/sourceforge/tmdmaker/ui/editor/gef3/editpolicies/VirtualEntityComponentEditPolicy.java TMD-Maker Plugin 42
		return new TableEditDialog<SubsetEntity>(getControllShell(), Messages.EditSubset,
				getModel());
	}

	/**
	 * 自分自身が実装対象でない場合に実行するコマンドを生成する。
	 * 
	 * @param editedValue
	 * @return
	 */
	private Command getDeleteCommand(AbstractEntityModel editedValue) {
		AbstractEntityModel table = getModel();
		if (table.isNotImplement() && !editedValue.isNotImplement()) {
			AbstractEntityModel original = ImplementRule.findOriginalImplementModel(table);
			return new ImplementDerivationModelsDeleteCommand(table, original);
		}
		return null;
	}

	/**
	 * 
	 * {@inheritDoc}
	 *
	 * @see jp.sourceforge.tmdmaker.ui.editor.gef3.editpolicies.AbstractEntityModelEditPolicy#createEditCommand(java.util.List,
	 *      jp.sourceforge.tmdmaker.model.AbstractEntityModel)
	 */
	@Override
	protected Command createEditCommand(List<EditAttribute> editAttributeList,
			AbstractEntityModel editedValue) {
		CompoundCommand ccommand = new CompoundCommand();
		ccommand.add(super.createEditCommand(editAttributeList, editedValue));
		Command deleteCommand = getDeleteCommand(editedValue);
		if (deleteCommand != null) {
			ccommand.add(deleteCommand);
		}
		return ccommand.unwrap();
	}

	/**
	 * {@inheritDoc}
	 * 
	 * @see org.eclipse.gef.editpolicies.ComponentEditPolicy#createDeleteCommand(org.eclipse.gef.requests.GroupRequest)
	 */
	@Override
	protected Command createDeleteCommand(GroupRequest deleteRequest) {
		CompoundCommand ccommand = new CompoundCommand();
File Project Line
jp/sourceforge/tmdmaker/model/IdentifierRef.java TMD-Maker Core Plugin 100
jp/sourceforge/tmdmaker/model/SurrogateKeyRef.java TMD-Maker Core Plugin 101
	}

	/**
	 * {@inheritDoc}
	 * 
	 * @see jp.sourceforge.tmdmaker.model.Attribute#getDataTypeDeclaration()
	 */
	@Override
	public DataTypeDeclaration getDataTypeDeclaration() {
		DataTypeDeclaration returnValue = super.getDataTypeDeclaration();
		if (returnValue == null) {
			returnValue = original.getDataTypeDeclaration();
		}
		return returnValue;
	}

	/**
	 * {@inheritDoc}
	 * 
	 * @see jp.sourceforge.tmdmaker.model.Attribute#copyTo(jp.sourceforge.tmdmaker.model.IAttribute)
	 */
	@Override
	public void copyTo(IAttribute to) {
		to.setDerivationRule(getDerivationRule());
		to.setDescription(getDescription());
		to.setLock(getLock());
		to.setValidationRule(getValidationRule());
		if (getDataTypeDeclaration() != null) {
			to.setDataTypeDeclaration(getDataTypeDeclaration().getCopy());
		} else {
			to.setDataTypeDeclaration(null);
		}
		to.setImplementName(getImplementName());
		to.setNullable(isNullable());
		// to.setName(getName());

	}
File Project Line
jp/sourceforge/tmdmaker/ui/dialogs/components/EntityEditSettingPanel.java TMD-Maker Plugin 112
jp/sourceforge/tmdmaker/ui/dialogs/components/EntityNameAndTypeSettingPanel.java TMD-Maker Plugin 102
		nameAutoCreateCheckBox = new Button(this, SWT.CHECK);
		nameAutoCreateCheckBox.setText(Messages.AutomaticGenerateEntityName);
		nameAutoCreateCheckBox.setLayoutData(gridData9);
		new Label(this, SWT.NONE);
		nameLabel = new Label(this, SWT.NONE);
		nameLabel.setText(Messages.EntityName);
		nameText = new Text(this, SWT.BORDER);
		nameText.setLayoutData(gridData1);
		nameText.addModifyListener(new org.eclipse.swt.events.ModifyListener() {
			public void modifyText(org.eclipse.swt.events.ModifyEvent e) {
				Text t = (Text) e.widget;
				entity.setName(t.getText());
File Project Line
jp/sourceforge/tmdmaker/model/VirtualSupersetTest.java TMD-Maker Core Test Plugin 101
jp/sourceforge/tmdmaker/model/VirtualSupersetTest.java TMD-Maker Core Test Plugin 125
jp/sourceforge/tmdmaker/model/VirtualSupersetTest.java TMD-Maker Core Test Plugin 156
	public void testSuper3Super() {
		List<AbstractEntityModel> list = new ArrayList<AbstractEntityModel>();
		Diagram diagram = new Diagram();
		Entity e1 = Entity.ofEvent(new Identifier("テスト1番号")).withDefaultAttribute();
		diagram.addChild(e1);
		Entity e2 = Entity.ofEvent(new Identifier("テスト2番号")).withDefaultAttribute();
		diagram.addChild(e2);
		Entity e3 = Entity.ofEvent(new Identifier("テスト2番号")).withDefaultAttribute();
		diagram.addChild(e3);
		VirtualSuperset vsp1 = VirtualSuperset.of(new ModelName("スーパーセット3"));