@Override
    public void mouseClicked(MouseEvent e) {
      PathButton pathButton = (PathButton) e.getSource();

      int index = buttonStack.indexOf(pathButton);
      if (index == buttonStack.size() - 1 || !pathButton.clickable.contains(e.getPoint())) {
        return;
      }

      switch (index) {
        case 0:
          TransitionManager.showMainScreen(null);
          removeLinksAbove(pathButton);
          break;
        case 1:
          TransitionManager.showAlbums(null);
          removeLinksAbove(pathButton);
          break;
        default:
          break;
      }
    }
  void draw() {
    if (pos != nextP) {
      nextP = pos;
      frames = 0;
    }

    if (++frames >= 30) {
      frames = 30;
    }

    // higher = more smooth and less responsive
    int smoothing = 12;

    double l = Math.sin((frames / 30.0) * PApplet.PI / smoothing);

    currP = nextP * l + currP * (1 - l);

    int transitionFrame = trans.getTransitionFrame();
    float transition = (float) transitionFrame / TRANSITION_FRAMES;
    float transitionColour = transition * 255;

    chos.background(transitionColour);
    drawSquare(currP, transitionColour, !trans.isRelaxedState());
  }
Example #3
0
 /**
  * リクエスト受信のインターフェイス。Borkerから呼び出される
  *
  * @param response レスポンス
  */
 public void receiveResponse(Response response) {
   transitionManager.goTo(response);
 }
Example #4
0
 /**
  * 引数(startPath)で指定されたコンテンツを持つBrowserPanelを生成する
  *
  * @param startPath 表示するコンテンツのパス
  */
 public BrowserPanel(String startPath) {
   this();
   Response response = broker.sendRequest(startPath);
   transitionManager.goTo(response);
 }