Ejemplo n.º 1
0
 /** Test of createNewCurrent method, of class PositionController. */
 @Test
 public void testCreateNewCurrent() {
   System.out.println("createNewCurrent");
   PositionController instance = new PositionController();
   instance.createNewCurrent();
   // TODO review the generated test code and remove the default call to fail.
   fail("The test case is a prototype.");
 }
  public void testFindsLinearPositionAll() throws Exception {
    int startX = 4;
    int startY = 5;
    Position position = new Position(startX, startY);

    PositionController controller = new PositionController(position);
    List<Position> positions = controller.findsLinearPositionAll();
    assertEquals(14, positions.size());
  }
Ejemplo n.º 3
0
 /** Test of setCurrent method, of class PositionController. */
 @Test
 public void testSetCurrent() {
   System.out.println("setCurrent");
   Object obj = null;
   PositionController instance = new PositionController();
   instance.setCurrent(obj);
   // TODO review the generated test code and remove the default call to fail.
   fail("The test case is a prototype.");
 }
Ejemplo n.º 4
0
 /** Test of getCurrent method, of class PositionController. */
 @Test
 public void testGetCurrent() {
   System.out.println("getCurrent");
   PositionController instance = new PositionController();
   Object expResult = null;
   Object result = instance.getCurrent();
   assertEquals(expResult, result);
   // TODO review the generated test code and remove the default call to fail.
   fail("The test case is a prototype.");
 }
Ejemplo n.º 5
0
  @Override
  public void saveSettings() {
    positionController.assignMissingComponentValues();

    final List<Component> components = positionController.getMissingComponents();
    step5cModel.setMissingPositionComponents(components);

    tableController.clearMarkedTableElements();
    tableController.turnSelectionOn();

    positionController = null;
    step5Panel = null;
  }
Ejemplo n.º 6
0
  @Override
  public void loadSettings() {
    final Position position = step5cModel.getPosition();
    positionController = new PositionController(position);
    final List<Component> components = step5cModel.getMissingPositionComponents();
    positionController.setMissingComponents(components);
    positionController.unassignMissingComponentValues();

    final String description = step5cModel.getDescription();
    final List<MissingComponentPanel> missingComponentPanels =
        positionController.getMissingComponentPanels();
    step5Panel = new Step5Panel(description, missingComponentPanels);

    tableController.turnSelectionOff();
    positionController.markComponents();
  }
Ejemplo n.º 7
0
 @Override
 public void onBrowserEvent(Event event) {
   String eventType = event.getType();
   if (BrowserEvents.MOUSEMOVE.equals(eventType)) {
     int currentPosition = positionController.getPosition(event);
     cell.setSize(startSize + currentPosition - startPosition);
   } else if (BrowserEvents.MOUSEUP.equals(eventType)) {
     DOM.releaseCapture(resizer);
     DOM.setEventListener(resizer, null);
   }
 }
Ejemplo n.º 8
0
  @Override
  public StepController getNext() {
    positionController = new PositionController();
    final Position p = positionController.getNextPositionWithMissingValues();
    if (p != null) {
      return new Step5cController(new Step5cModel(p), firstLineWithData);
    }

    positionController = null;
    return null;
  }
Ejemplo n.º 9
0
  @Override
  public boolean isNecessary() {
    positionController = new PositionController();
    final Position p = positionController.getNextPositionWithMissingValues();

    if (p == null) {
      logger.info("Skip Step 5c since there are not any Positions" + " with missing values");
      return false;
    }

    step5cModel = new Step5cModel(p);
    return true;
  }
Ejemplo n.º 10
0
 @Override
 public boolean onBrowserEvent(
     Cell.Context context,
     Element parent,
     C value,
     NativeEvent event,
     ValueUpdater<C> cValueUpdater) {
   resizer = cell.getResizeElement().cast();
   if (event.getEventTarget().equals(resizer)) {
     String eventType = event.getType();
     if (BrowserEvents.MOUSEDOWN.equals(eventType)) {
       startPosition = positionController.getPosition(Event.getCurrentEvent());
       int events =
           Event.getTypeInt(BrowserEvents.MOUSEMOVE) | Event.getTypeInt(BrowserEvents.MOUSEUP);
       DOM.setEventListener(resizer, eventListener);
       DOM.sinkEvents(resizer, events);
       DOM.setCapture(resizer);
       startSize = cell.getSize(parent);
       event.preventDefault();
       return true;
     }
   }
   return false;
 }
Ejemplo n.º 11
0
 @Override
 public boolean isFinished() {
   return positionController.checkMissingComponentValues();
 }