Esempio n. 1
0
  private void drawArea(Area area, View view, Drawable drawable, Canvas canvas) {
    int left = area.getLeft(view, drawable);
    int top = area.getTop(view, drawable);
    int right = area.getRight(view, drawable);
    int bottom = area.getBottom(view, drawable);

    if (drawable != null) {
      drawable.setBounds(left, top, right, bottom);
      drawable.draw(canvas);
    }
  }
 /*
  * getFloor() - Environment check. Checks both the currently active windows
  * and the bottom of the screen. Returns the border if on one. Controls the
  * current Floor/Ceiling attribute of each mascot.
  */
 public Border getFloor(boolean ignoreSeparator) {
   if (getIE().onTop(mascot.getAnchor())) {
     FloorCeiling fc = getIE().getTop(mascot.getAnchor());
     if (!checkLayering(fc.getArea())) {
       mascot.setCurFC(null);
       return NotOnVisibleBorder.INSTANCE;
     }
     if (currentWorkArea == null) currentWorkArea = impl.getWorkArea();
     // Don't let the mascot get footing on any window ceiling within 64px
     // of the top of the screen.
     if (fc.getY() >= currentWorkArea.getTop() + 64) {
       mascot.setCurFC(fc);
       return getIE().getTop(mascot.getAnchor());
     }
   }
   if (getWorkArea().getBottomBorder().isOn(mascot.getAnchor())) {
     if (!ignoreSeparator || isScreenTopBottom()) {
       mascot.setCurFC(null);
       return getWorkArea().getBottomBorder();
     }
   }
   mascot.setCurFC(null);
   return NotOnBorder.INSTANCE;
 }
 public boolean locationIndicatesIndexFollowingWidget(Area widgetArea, Location location) {
   return location.getTop() > widgetArea.getTop() + widgetArea.getHeight() / 2;
 }