Commit cf3b981c authored by Simon Barner's avatar Simon Barner
Browse files

- Add icons

- Use NamedCommentedModelElementHandlerBase
refs 2562
parent 5bf1d981
AF3TaskUIActivator.java 7f0fb5a0f756ca70f3fbc90e1b9bc242262dc0be RED
DefaultStyle.java f5f1a0ec2158ea639c243de95e013fe0061cbce5 RED
DefaultStyle.java fe3066fd2f1fd95a866c961473d3b19a925a899c YELLOW
TaskRectangle.java 577a437d3bb4b71280d33205139706a8f8953943 RED
......@@ -27,7 +27,7 @@ import org.fortiss.af3.task.model.TaskArchitecture;
*/
public class DefaultStyle {
/** {@link Task} background color. */
public static Color TASK_BACKGROUND = createColor(0, 142, 0);
public static Color TASK_BACKGROUND = createColor(90, 180, 90);
/** {@link Task} foreground color. */
public static Color TASK_FOREGROUND = createColor(255, 255, 255);
......
BufferedSignalInputPortHandler.java 50c4a40bf4ec461b9252e530492a45cc61ed2f4d RED
SignalHandler.java 1966c097bc5bdace0875f82a3dcae812ad05f74c RED
SignalHandler.java 50a00433fdae1ece8e234f4662a2c68de986333c YELLOW
SignalInputPortHandler.java a8f93b798bfd42274b9814263038f601fd81b4ff RED
SignalOutputPortHandler.java c0a546d3fbfafe3db9dc1eecd0ec323bb7e709ba RED
TaskArchitectureHandler.java 0ebae86e4291736c227c1c7f3dec42d906c59318 RED
TaskHandler.java 51d75c0fded1256a68960819fd50d5eaf3a27166 RED
TaskArchitectureHandler.java 0525acd8cb36ef5dd5678ae56bc2fd3ad8ad4110 YELLOW
TaskHandler.java 1b3fb716c786cce5ef35f84991abd6a6b243b6b9 YELLOW
......@@ -17,20 +17,14 @@ package org.fortiss.af3.task.ui.handler;
import org.eclipse.jface.resource.ImageDescriptor;
import org.fortiss.af3.task.model.Signal;
import org.fortiss.tooling.kernel.ui.extension.base.ModelElementHandlerBase;
import org.fortiss.tooling.kernel.ui.extension.base.NamedCommentedModelElementHandlerBase;
/**
* Model element handler for {@link Signal}s.
*
* @author eder
*/
public class SignalHandler extends ModelElementHandlerBase<Signal> {
/** {@inheritDoc} */
@Override
public String getName(Signal element) {
return "Signal";
}
public class SignalHandler extends NamedCommentedModelElementHandlerBase<Signal> {
/** {@inheritDoc} */
@Override
......
......@@ -15,7 +15,9 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.task.ui.handler;
import java.util.ArrayList;
import static java.util.Collections.unmodifiableList;
import static org.fortiss.af3.task.ui.AF3TaskUIActivator.getImageDescriptor;
import java.util.List;
import org.eclipse.emf.ecore.EObject;
......@@ -31,23 +33,15 @@ import org.fortiss.tooling.kernel.ui.extension.base.NamedCommentedModelElementHa
public class TaskArchitectureHandler extends
NamedCommentedModelElementHandlerBase<TaskArchitecture> {
/** {@inheritDoc} */
@Override
public String getName(TaskArchitecture element) {
return "Task Architecture";
}
/** {@inheritDoc} */
@Override
public List<EObject> getSubnodes(TaskArchitecture element) {
List<EObject> results = new ArrayList<EObject>();
results.addAll(element.getTasks());
return results;
return unmodifiableList(element.getTasks());
}
/** {@inheritDoc} */
@Override
public ImageDescriptor getIconImageDescriptor() {
return null;
return getImageDescriptor("icons/task_architecture.png");
}
}
......@@ -15,36 +15,32 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.task.ui.handler;
import java.util.Collections;
import static java.util.Collections.unmodifiableList;
import static org.fortiss.af3.task.ui.AF3TaskUIActivator.getImageDescriptor;
import java.util.List;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.resource.ImageDescriptor;
import org.fortiss.af3.task.model.Task;
import org.fortiss.tooling.kernel.ui.extension.base.ModelElementHandlerBase;
import org.fortiss.tooling.kernel.ui.extension.base.NamedCommentedModelElementHandlerBase;
/**
* Model element handler for {@link Task}s.
*
* @author eder
*/
public class TaskHandler extends ModelElementHandlerBase<Task> {
/** {@inheritDoc} */
@Override
public String getName(Task element) {
return element.getName();
}
public class TaskHandler extends NamedCommentedModelElementHandlerBase<Task> {
/** {@inheritDoc} */
@Override
public ImageDescriptor getIconImageDescriptor() {
return null;
return getImageDescriptor("icons/task.png");
}
/** {@inheritDoc} */
@Override
public List<EObject> getConnectors(Task element) {
return Collections.unmodifiableList(element.getConnectors());
return unmodifiableList(element.getConnectors());
}
}
PrototypeProvider.java 6508c76dd4ff29396fa395cf6ee20d0826d0439d RED
PrototypeProvider.java debfef2ea0ab47e344ff1a5d39a392d017330e43 YELLOW
......@@ -15,6 +15,8 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.task.ui.prototype;
import static org.fortiss.af3.task.util.TaskModelElementFactory.createComponentToTaskAllocationTable;
import org.fortiss.af3.task.util.TaskModelElementFactory;
import org.fortiss.tooling.kernel.extension.base.PrototypeProviderBase;
......@@ -31,8 +33,8 @@ public class PrototypeProvider extends PrototypeProviderBase {
/** {@inheritDoc} */
@Override
protected void registerPrototypes() {
registerPrimaryPrototype("TaskArchitecture",
TaskModelElementFactory.createTaskArchitecture(), CATEGORY);
registerPrimaryPrototype("Task Architecture",
TaskModelElementFactory.createTaskArchitecture("Task Architecture"), CATEGORY);
registerPrimaryPrototype("Task", TaskModelElementFactory.createTask("Task"), CATEGORY);
registerPrototype("InputSignalPort", TaskModelElementFactory.createInputSignalPort(),
CATEGORY);
......@@ -40,5 +42,10 @@ public class PrototypeProvider extends PrototypeProviderBase {
TaskModelElementFactory.createInputBufferedSignalPort(), CATEGORY);
registerPrototype("OutputSignalPort", TaskModelElementFactory.createOutputSignalPort(),
CATEGORY);
registerPrimaryPrototype(
"La \u2192 Ta", // La -> Ta
createComponentToTaskAllocationTable("La \u2192 Ta"),
org.fortiss.af3.allocation.ui.prototypes.PrototypeProvider.CATEGORY);
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment