jfxrt

iewportWidth();
        TextAreaSkin.this.updatePrefViewportHeight();
      }
    });
    scrollPane.viewportBoundsProperty().addListener(new InvalidationListener()
    {
      public void invalidated(Observable paramAnonymousObservable)
      {
        if (scrollPane.getViewportBounds() != null)
        {
          Bounds localBounds = scrollPane.getViewportBounds();
          if ((oldViewportBounds == null) || (oldViewportBounds.getWidth() != localBounds.getWidth()) || (oldViewportBounds.getHeight() != localBounds.getHeight()))
          {
            invalidateMetrics();
            oldViewportBounds = localBounds;
            contentView.requestLayout();
          }
        }
      }
    });
    paramTextArea.scrollTopProperty().addListener(new ChangeListener()
    {
      public void changed(ObservableValue<? extends Number> paramAnonymousObservableValue, Number paramAnonymousNumber1, Number paramAnonymousNumber2)
      {
        double d = paramAnonymousNumber2.doubleValue() < TextAreaSkin.this.getScrollTopMax() ? paramAnonymousNumber2.doubleValue() / TextAreaSkin.this.getScrollTopMax() : 1.0D;
        scrollPane.setVvalue(d);
      }
    });
    paramTextArea.scrollLeftProperty().addListener(new ChangeListener()
    {
      public void changed(ObservableValue<? extends Number> paramAnonymousObservableValue, Number paramAnonymousNumber1, Number paramAnonymousNumber2)
      {
        double d = paramAnonymousNumber2.doubleValue() < TextAreaSkin.this.getScrollLeftMax() ? paramAnonymousNumber2.doubleValue() / TextAreaSkin.this.getScrollLeftMax() : 1.0D;
        scrollPane.setHvalue(d);
      }
    });
    paramTextArea.textProperty().addListener(new InvalidationListener()
    {
      public void invalidated(Observable paramAnonymousObservable)
      {
        invalidateMetrics();
        ((Text)paragraphNodes.getChildren().get(0)).setText(paramTextArea.textProperty().getValueSafe());
        contentView.requestLayout();
      }
    });
    usePromptText = new BooleanBinding()
    {
      protected boolean computeValue()
      {
        String str1 = paramTextArea.getText();
        String str2 = paramTextArea.getPromptText();
        return ((str1 == null) || (str1.isEmpty())) && (str2 != null) && (!str2.isEmpty());
      }
    };
    if (usePromptText.get()) {
      createPromptNode();
    }
    usePromptText.addListener(new InvalidationListener()
    {
      public void invalidated(Observable paramAnonymousObservable)
      {
        TextAreaSkin.this.createPromptNode();
        requestLayout();
      }
    });
    updateHighlightFill();
    updatePrefViewportWidth();
    updatePrefViewportHeight();
    if (paramTextArea.isFocused()) {
      setCaretAnimating(true);
    }
    if (PlatformUtil.isEmbedded())
    {
      selectionHandle1.setRotate(180.0D);
      EventHandler local20 = new EventHandler()
      {
        public void handle(MouseEvent paramAnonymousMouseEvent)
        {
          pressX = paramAnonymousMouseEvent.getX();
          pressY = paramAnonymousMouseEvent.getY();
          paramAnonymousMouseEvent.consume();
        }
      };
      caretHandle.setOnMousePressed(local20);
      selectionHandle1.setOnMousePressed(local20);
      selectionHandle2.setOnMousePressed(local20);
      caretHandle.setOnMouseDragged(new EventHandler()
      {
        public void handle(MouseEvent paramAnonymousMouseEvent)
        {
          Text localText = TextAreaSkin.this.getTextNode();
          Point2D localPoint2D1 = localText.localToScene(0.0D, 0.0D);
          Point2D localPoint2D2 = new Point2D(paramAnonymousMouseEvent.getSceneX() - localPoint2D1.getX() + 10.0D - pressX + caretHandle.getWidth() / 2.0D, paramAnonymousMouseEvent.getSceneY() - localPoint2D1.getY() - pressY - 6.0D);
          HitInfo localHitInfo = localText.impl_hitTestChar(TextAreaSkin.this.translateCaretPosition(localPoint2D2));
          int i = localHitInfo.getCharIndex();
          if (i > 0)
          {
            int j = localText.getImpl_caretPosition();
            localText.setImpl_caretPosition(i);
            PathElement localPathElement = localText.getImpl_caretShape()[0];
            if (((localPathElement instanceof MoveTo)) && (((MoveTo)localPathElement).getY() > paramAnonymousMouseEvent.getY() - TextAreaSkin.this.getTextTranslateY())) {
              localHitInfo.setCharIndex(i - 1);
            }
            localText.setImpl_caretPosition(j);
          }
          positionCaret(localHitInfo, false, false);
          paramAnonymousMouseEvent.consume();
        }
      });
      selectionHandle1.setOnMouseDragged(new EventHandler()
      {
        public void handle(MouseEvent paramAnonymousMouseEvent)
        {
          TextArea localTextArea = (TextArea)getSkinnable();
          Text localText = TextAreaSkin.this.getTextNode();
          Point2D localPoint2D1 = localText.localToScene(0.0D, 0.0D);
          Point2D localPoint2D2 = new Point2D(paramAnonymousMouseEvent.getSceneX() - localPoint2D1.getX() + 10.0D - pressX + selectionHandle1.getWidth() / 2.0D, paramAnonymousMouseEvent.getSceneY() - localPoint2D1.getY() - pressY + selectionHandle1.getHeight() + 5.0D);
          HitInfo localHitInfo = localText.impl_hitTestChar(TextAreaSkin.this.translateCaretPosition(localPoint2D2));
          int i = localHitInfo.getCharIndex();
          if (localTextArea.getAnchor() < localTextArea.getCaretPosition()) {
            localTextArea.selectRange(localTextArea.getCaretPosition(), localTextArea.getAnchor());
          }
          if (i >= 0)
          {
            if (i >= localTextArea.getAnchor()) {
              i = localTextArea.getAnchor();
            }
            int j = localText.getImpl_caretPosition();
            localText.setImpl_caretPosition(i);
            PathElement localPathElement = localText.getImpl_caretShape()[0];
            if (((localPathElement instanceof MoveTo)) && (((MoveTo)localPathElement).getY() > paramAnonymousMouseEvent.getY() - TextAreaSkin.this.getTextTranslateY())) {
              localHitInfo.setCharIndex(i - 1);
            }
            localText.setImpl_caretPosition(j);
            positionCaret(localHitInfo, true, false);
          }
          paramAnonymousMouseEvent.consume();
        }
      });
      selectionHandle2.setOnMouseDragged(new EventHandler()
      {
        public void handle(MouseEvent paramAnonymousMouseEvent)
        {
          TextArea localTextArea = (TextArea)getSkinnable();
          Text localText = TextAreaSkin.this.getTextNode();
          Point2D localPoint2D1 = localText.localToScene(0.0D, 0.0D);
          Point2D localPoint2D2 = new Point2D(paramAnonymousMouseEvent.getSceneX() - localPoint2D1.getX() + 10.0D - pressX + selectionHandle2.getWidth() / 2.0D, paramAnonymousMouseEvent.getSceneY() - localPoint2D1.getY() - pressY - 6.0D);
          HitInfo localHitInfo = localText.impl_hitTestChar(TextAreaSkin.this.translateCaretPosition(localPoint2D2));
          int i = localHitInfo.getCharIndex();
          if (localTextArea.getAnchor() > localTextArea.getCaretPosition()) {
            localTextArea.selectRange(localTextArea.getCaretPosition(), localTextArea.getAnchor());
          }
          if (i > 0)
          {
            if (i <= localTextArea.getAnchor() + 1) {
              i = Math.min(localTextArea.getAnchor() + 2, localTextArea.getLength());
            }
            int j = localText.getImpl_caretPosition();
            localText.setImpl_caretPosition(i);
            PathElement localPathElement = localText.getImpl_caretShape()[0];
            if (((localPathElement instanceof MoveTo)) && (((MoveTo)localPathElement).getY() > paramAnonymousMouseEvent.getY() - TextAreaSkin.this.getTextTranslateY())) {
              localHitInfo.setCharIndex(i - 1);
            }
            localText.setImpl_caretPosition(j);
            positionCaret(localHitInfo, true, false);
          }
          paramAnonymousMouseEvent.consume();
        }
      });
    }
  }
  
  private void createPromptNode()
  {
    if ((promptNode == null) && (usePromptText.get()))
    {
      promptNode = new Text();
      contentView.getChildren().add(0, promptNode);
      promptNode.setManaged(false);
      promptNode.getStyleClass().add("text");
      promptNode.visibleProperty().bind(usePromptText);
      promptNode.fontProperty().bind(font);
      promptNode.textProperty().bind(((TextArea)getSkinnable()).promptTextProperty());
      promptNode.fillProperty().bind(promptTextFill);
    }
  }
  
  private void addParagraphNode(int paramInt, String paramString)
  {
    TextArea localTextArea = (TextArea)getSkinnable();
    Text localText = new Text(paramString);
    localText.setTextOrigin(VPos.TOP);
    localText.setManaged(false);
    localText.getStyleClass().add("text");
    paragraphNodes.getChildren().add(paramInt, localText);
    localText.fontProperty().bind(font);
    localText.fillProperty().bind(textFill);
    localText.impl_selectionFillProperty().bind(highlightTextFill);
  }
  
  public void layoutChildren()
  {
    scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED);
    scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED);
    super.layoutChildren();
    Bounds localBounds = scrollPane.getViewportBounds();
    if ((localBounds != null) && ((localBounds.getWidth() < contentView.minWidth(-1.0D)) || (localBounds.getHeight() < contentView.minHeight(-1.0D))))
    {
      scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
      scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
    }
  }
  
  public void dispose()
  {
    throw new UnsupportedOperationException();
  }
  
  public double getBaselineOffset()
  {
    return ((FontMetrics)fontMetrics.get()).getAscent() + getInsets().getTop();
  }
  
  public char getCharacter(int paramInt)
  {
    int i = paragraphNodes.getChildren().size();
    int j = 0;
    int k = paramInt;
    String str = null;
    while (j < i)
    {
      Text localText = (Text)paragraphNodes.getChildren().get(j);
      str = localText.getText();
      int m = str.length() + 1;
      if (k < m) {
        break;
      }
      k -= m;
      j++;
    }
    return k == str.length() ? '\n' : str.charAt(k);
  }
  
  public int getInsertionPoint(double paramDouble1, double paramDouble2)
  {
    TextArea localTextArea = (TextArea)getSkinnable();
    int i = paragraphNodes.getChildren().size();
    int j = -1;
    if (i > 0)
    {
      Insets localInsets = contentView.getInsets();
      if (paramDouble2 < localInsets.getTop())
      {
        Text localText1 = (Text)paragraphNodes.getChildren().get(0);
        j = getNextInsertionPoint(localText1, paramDouble1, -1, VerticalDirection.DOWN);
      }
      else
      {
        int k;
        if (paramDouble2 > localInsets.getTop() + contentView.getHeight())
        {
          k = i - 1;
          Text localText2 = (Text)paragraphNodes.getChildren().get(k);
          j = getNextInsertionPoint(localText2, paramDouble1, -1, VerticalDirection.UP) + (localTextArea.getLength() - localText2.getText().length());
        }
        else
        {
          k = 0;
          for (int m = 0; m < i; m++)
          {
            Text localText3 = (Text)paragraphNodes.getChildren().get(m);
            Bounds localBounds = localText3.getBoundsInLocal();
            double d = localText3.getLayoutY() + localBounds.getMinY();
            if ((paramDouble2 >= d) && (paramDouble2 < d + localText3.getBoundsInLocal().getHeight()))
            {
              j = getInsertionPoint(localText3, paramDouble1 - localText3.getLayoutX(), paramDouble2 - localText3.getLayoutY()) + k;
              break;
            }
            k += localText3.getText().length() + 1;
          }
        }
      }
    }
    return j;
  }
  
  public void positionCaret(HitInfo paramHitInfo, boolean paramBoolean1, boolean paramBoolean2)
  {
    int i = paramHitInfo.getInsertionIndex();
    int j = (i > 0) && (i < ((TextArea)getSkinnable()).getLength()) && (((TextArea)getSkinnable()).getText().codePointAt(i - 1) == 10) ? 1 : 0;
    if ((!paramHitInfo.isLeading()) && (j != 0))
    {
      paramHitInfo.setLeading(true);
      i--;
    }
    if (paramBoolean1)
    {
      if (paramBoolean2) {
        ((TextArea)getSkinnable()).extendSelection(i);
      } else {
        ((TextArea)getSkinnable()).selectPositionCaret(i);
      }
    }
    else {
      ((TextArea)getSkinnable()).positionCaret(i);
    }
  }
  
  private double getScrollTopMax()
  {
    return Math.max(0.0D, contentView.getHeight() - scrollPane.getViewportBounds().getHeight());
  }
  
  private double getScrollLeftMax()
  {
    return Math.max(0.0D, contentView.getWidth() - scrollPane.getViewportBounds().getWidth());
  }
  
  private int getInsertionPoint(Text paramText, double paramDouble1, double paramDouble2)
  {
    HitInfo localHitInfo = paramText.impl_hitTestChar(new Point2D(paramDouble1, paramDouble2));
    return localHitInfo.getInsertionIndex();
  }
  
  public int getNextInsertionPoint(double paramDouble, int paramInt, VerticalDirection paramVerticalDirection)
  {
    return 0;
  }
  
  private int getNextInsertionPoint(Text paramText, double paramDouble, int paramInt, VerticalDirection paramVerticalDirection)
  {
    return 0;
  }
  
  public Rectangle2D getCharacterBounds(int paramInt)
  {
    TextArea localTextArea = (TextArea)getSkinnable();
    int i = paragraphNodes.getChildren().size();
    int j = localTextArea.getLength() + 1;
    Text localText = null;
    do
    {
      localText = (Text)paragraphNodes.getChildren().get(--i);
      j -= localText.getText().length() + 1;
    } while (paramInt < j);
    int k = paramInt - j;
    int m = 0;
    if (k == localText.getText().length())
    {
      k--;
      m = 1;
    }
    characterBoundingPath.getElements().clear();
    characterBoundingPath.getElements().addAll(localText.impl_getRangeShape(k, k + 1));
    characterBoundingPath.setLayoutX(localText.getLayoutX());
    characterBoundingPath.setLayoutY(localText.getLayoutY());
    Bounds localBounds = characterBoundingPath.getBoundsInLocal();
    double d1 = localBounds.getMinX() + localText.getLayoutX() - localTextArea.getScrollLeft();
    double d2 = localBounds.getMinY() + localText.getLayoutY() - localTextArea.getScrollTop();
    double d3 = localBounds.isEmpty() ? 0.0D : localBounds.getWidth();
    double d4 = localBounds.isEmpty() ? 0.0D : localBounds.getHeight();
    if (m != 0)
    {
      d1 += d3;
      d3 = 0.0D;
    }
    return new Rectangle2D(d1, d2, d3, d4);
  }
  
  public void scrollCharacterToVisible(final int paramInt)
  {
    Platform.runLater(new Runnable()
    {
      public void run()
      {
        if (((TextArea)getSkinnable()).getLength() == 0) {
          return;
        }
        Rectangle2D localRectangle2D = getCharacterBounds(paramInt);
        TextAreaSkin.this.scrollBoundsToVisible(localRectangle2D);
      }
    });
  }
  
  private void scrollCaretToVisible()
  {
    TextArea localTextArea = (TextArea)getSkinnable();
    Bounds localBounds = caretPath.getLayoutBounds();
    double d1 = localBounds.getMinX() - localTextArea.getScrollLeft();
    double d2 = localBounds.getMinY() - localTextArea.getScrollTop();
    double d3 = localBounds.getWidth();
    double d4 = localBounds.getHeight();
    if (PlatformUtil.isEmbedded()) {
      if (caretHandle.isVisible())
      {
        d4 += caretHandle.getHeight();
      }
      else if ((selectionHandle1.isVisible()) && (selectionHandle2.isVisible()))
      {
        d1 -= selectionHandle1.getWidth() / 2.0D;
        d2 -= selectionHandle1.getHeight();
        d3 += selectionHandle1.getWidth() / 2.0D + selectionHandle2.getWidth() / 2.0D;
        d4 += selectionHandle1.getHeight() + selectionHandle2.getHeight();
      }
    }
    scrollBoundsToVisible(new Rectangle2D(d1, d2, d3, d4));
  }
  
  private void scrollBoundsToVisible(Rectangle2D paramRectangle2D)
  {
    TextArea localTextArea = (TextArea)getSkinnable();
    Bounds localBounds = scrollPane.getViewportBounds();
    Insets localInsets = contentView.getInsets();
    double d1 = localBounds.getWidth();
    double d2 = localBounds.getHeight();
    double d3 = localTextArea.getScrollTop();
    double d4 = localTextArea.getScrollLeft();
    double d5 = 6.0D;
    double d6;
    if (paramRectangle2D.getMinY() < 0.0D)
    {
      d6 = d3 + paramRectangle2D.getMinY();
      if (d6 <= localInsets.getTop()) {
        d6 = 0.0D;
      }
      localTextArea.setScrollTop(d6);
    }
    else if (localInsets.getTop() + paramRectangle2D.getMaxY() > d2)
    {
      d6 = d3 + localInsets.getTop() + paramRectangle2D.getMaxY() - d2;
      if (d6 >= getScrollTopMax() - localInsets.getBottom()) {
        d6 = getScrollTopMax();
      }
      localTextArea.setScrollTop(d6);
    }
    if (paramRectangle2D.getMinX() < 0.0D)
    {
      d6 = d4 + paramRectangle2D.getMinX() - d5;
      if (d6 <= localInsets.getLeft() + d5) {
        d6 = 0.0D;
      }
      localTextArea.setScrollLeft(d6);
    }
    else if (localInsets.getLeft() + paramRectangle2D.getMaxX() > d1)
    {
      d6 = d4 + localInsets.getLeft() + paramRectangle2D.getMaxX() - d1 + d5;
      if (d6 >= getScrollLeftMax() - localInsets.getRight() - d5) {
        d6 = getScrollLeftMax();
      }
      localTextArea.setScrollLeft(d6);
    }
  }
  
  private void updatePrefViewportWidth()
  {
    int i = ((TextArea)getSkinnable()).getPrefColumnCount();
    Insets localInsets = contentView.getInsets();
    scrollPane.setPrefViewportWidth(i * characterWidth + localInsets.getLeft() + localInsets.getRight());
  }
  
  private void updatePrefViewportHeight()
  {
    int i = ((TextArea)getSkinnable()).getPrefRowCount();
    Insets localInsets = contentView.getInsets();
    scrollPane.setPrefViewportHeight(i * lineHeight + localInsets.getTop() + localInsets.getBottom());
  }
  
  private void updateFontMetrics()
  {
    lineHeight = ((FontMetrics)fontMetrics.get()).getLineHeight();
    characterWidth = ((FontMetrics)fontMetrics.get()).computeStringWidth("W");
  }
  
  protected void updateHighlightFill()
  {
    Iterator localIterator = selectionHighlightGroup.getChildren().iterator();
    while (localIterator.hasNext())
    {
      Node localNode = (Node)localIterator.next();
      Path localPath = (Path)localNode;
      localPath.setFill((Paint)highlightFill.get());
    }
  }
  
  private double getTextTranslateX()
  {
    return contentView.getInsets().getLeft();
  }
  
  private double getTextTranslateY()
  {
    return contentView.getInsets().getTop();
  }
  
  private double getTextLeft()
  {
    return 0.0D;
  }
  
  private Point2D translateCaretPosition(Point2D paramPoint2D)
  {
    return paramPoint2D;
  }
  
  private Text getTextNode()
  {
    return (Text)paragraphNodes.getChildren().get(0);
  }
  
  public HitInfo getIndex(MouseEvent paramMouseEvent)
  {
    Text localText = getTextNode();
    Point2D localPoint2D = new Point2D(paramMouseEvent.getX() - localText.getLayoutX(), paramMouseEvent.getY() - getTextTranslateY());
    HitInfo localHitInfo = localText.impl_hitTestChar(translateCaretPosition(localPoint2D));
    int i = localHitInfo.getCharIndex();
    if (i > 0)
    {
      int j = localText.getImpl_caretPosition();
      localText.setImpl_caretPosition(i);
      PathElement localPathElement = localText.getImpl_caretShape()[0];
      if (((localPathElement instanceof MoveTo)) && (((MoveTo)localPathElement).getY() > paramMouseEvent.getY() - getTextTranslateY())) {
        localHitInfo.setCharIndex(i - 1);
      }
      localText.setImpl_caretPosition(j);
    }
    return localHitInfo;
  }
  
  protected void downLines(int paramInt, boolean paramBoolean1, boolean paramBoolean2)
  {
    Text localText = getTextNode();
    Bounds localBounds = caretPath.getLayoutBounds();
    double d1 = (localBounds.getMinY() + localBounds.getMaxY()) / 2.0D + paramInt * lineHeight;
    if (d1 < 0.0D) {
      d1 = 0.0D;
    }
    double d2 = targetCaretX >= 0.0D ? targetCaretX : localBounds.getMaxX() + getTextTranslateX();
    HitInfo localHitInfo = localText.impl_hitTestChar(translateCaretPosition(new Point2D(d2, d1)));
    int i = localHitInfo.getCharIndex();
    if (i > 0)
    {
      localText.setImpl_caretPosition(i);
      PathElement localPathElement = localText.getImpl_caretShape()[0];
      if (((localPathElement instanceof MoveTo)) && (((MoveTo)localPathElement).getY() > d1)) {
        localHitInfo.setCharIndex(i - 1);
      }
    }
    positionCaret(localHitInfo, paramBoolean1, paramBoolean2);
    targetCaretX = d2;
  }
  
  public void previousLine(boolean paramBoolean)
  {
    downLines(-1, paramBoolean, false);
  }
  
  public void nextLine(boolean paramBoolean)
  {
    downLines(1, paramBoolean, false);
  }
  
  public void previousPage(boolean paramBoolean)
  {
    downLines(-(int)(scrollPane.getViewportBounds().getHeight() / lineHeight), paramBoolean, false);
  }
  
  public void nextPage(boolean paramBoolean)
  {
    downLines((int)(scrollPane.getViewportBounds().getHeight() / lineHeight), paramBoolean, false);
  }
  
  public void lineStart(boolean paramBoolean1, boolean paramBoolean2)
  {
    Bounds localBounds = caretPath.getLayoutBounds();
    double d = (localBounds.getMinY() + localBounds.getMaxY()) / 2.0D;
    HitInfo localHitInfo = getTextNode().impl_hitTestChar(translateCaretPosition(new Point2D(getTextLeft(), d)));
    positionCaret(localHitInfo, paramBoolean1, paramBoolean2);
  }
  
  public void lineEnd(boolean paramBoolean1, boolean paramBoolean2)
  {
    targetCaretX = Double.MAX_VALUE;
    downLines(0, paramBoolean1, paramBoolean2);
    targetCaretX = -1.0D;
  }
  
  public void paragraphStart(boolean paramBoolean1, boolean paramBoolean2)
  {
    TextArea localTextArea = (TextArea)getSkinnable();
    String str = localTextArea.textProperty().getValueSafe();
    int i = localTextArea.getCaretPosition();
    if (i > 0)
    {
      if ((paramBoolean1) && (str.codePointAt(i - 1) == 10)) {
        i--;
      }
      while ((i > 0) && (str.codePointAt(i - 1) != 10)) {
        i--;
      }
      if (paramBoolean2) {
        localTextArea.selectPositionCaret(i);
      } else {
        localTextArea.positionCaret(i);
      }
    }
  }
  
  public void paragraphEnd(boolean paramBoolean1, boolean paramBoolean2)
  {
    TextArea localTextArea = (TextArea)getSkinnable();
    String str = localTextArea.textProperty().getValueSafe();
    int i = localTextArea.getCaretPosition();
    int j = str.length();
    if (i < j - 1)
    {
      if ((paramBoolean1) && (str.codePointAt(i) == 10)) {
        i++;
      }
      while ((i < j - 1) && (str.codePointAt(i) != 10)) {
        i++;
      }
      if (paramBoolean2) {
        localTextArea.selectPositionCaret(i);
      } else {
        localTextArea.positionCaret(i);
      }
    }
  }
  
  protected PathElement[] getUnderlineShape(int paramInt1, int paramInt2)
  {
    int i = 0;
    Iterator localIterator = paragraphNodes.getChildren().iterator();
    while (localIterator.hasNext())
    {
      Node localNode = (Node)localIterator.next();
      Text localText = (Text)localNode;
      int j = i + localText.textProperty().getValueSafe().length();
      if (j >= paramInt1) {
        return localText.impl_getUnderlineShape(paramInt1 - i, paramInt2 - i);
      }
      i = j + 1;
    }
    return null;
  }
  
  protected PathElement[] getRangeShape(int paramInt1, int paramInt2)
  {
    int i = 0;
    Iterator localIterator = paragraphNodes.getChildren().iterator();
    while (localIterator.hasNext())
    {
      Node localNode = (Node)localIterator.next();
      Text localText = (Text)localNode;
      int j = i + localText.textProperty().getValueSafe().length();
      if (j >= paramInt1) {
        return localText.impl_getRangeShape(paramInt1 - i, paramInt2 - i);
      }
      i = j + 1;
    }
    return null;
  }
  
  protected void addHighlight(List<? extends Node> paramList, int paramInt)
  {
    int i = 0;
    Object localObject = null;
    Iterator localIterator = paragraphNodes.getChildren().iterator();
    Node localNode;
    while (localIterator.hasNext())
    {
      localNode = (Node)localIterator.next();
      Text localText = (Text)localNode;
      int j = i + localText.textProperty().getValueSafe().length();
      if (j >= paramInt)
      {
        localObject = localText;
        break;
      }
      i = j + 1;
    }
    if (localObject != null)
    {
      localIterator = paramList.iterator();
      while (localIterator.hasNext())
      {
        localNode = (Node)localIterator.next();
        localNode.setLayoutX(((Text)localObject).getLayoutX());
        localNode.setLayoutY(((Text)localObject).getLayoutY());
      }
    }
    contentView.getChildren().addAll(paramList);
  }
  
  protected void removeHighlight(List<? extends Node> paramList)
  {
    contentView.getChildren().removeAll(paramList);
  }
  
  public void deleteChar(boolean paramBoolean)
  {
    int i = !((TextArea)getSkinnable()).deleteNextChar() ? 1 : paramBoolean ? 0 : !((TextArea)getSkinnable()).deletePreviousChar() ? 1 : 0;
    if (i != 0) {}
  }
  
  public Point2D getMenuPosition()
  {
    contentView.layoutChildren();
    Point2D localPoint2D = super.getMenuPosition();
    if (localPoint2D != null)
    {
      Insets localInsets = contentView.getInsets();
      localPoint2D = new Point2D(Math.max(0.0D, localPoint2D.getX() - localInsets.getLeft() - ((TextArea)getSkinnable()).getScrollLeft()), Math.max(0.0D, localPoint2D.getY() - localInsets.getTop() - ((TextArea)getSkinnable()).getScrollTop()));
    }
    return localPoint2D;
  }
  
  private class ContentView
    extends Region
  {
    private ContentView()
    {
      getStyleClass().add("content");
      addEventHandler(MouseEvent.MOUSE_PRESSED, new EventHandler()
      {
        public void handle(MouseEvent paramAnonymousMouseEvent)
        {
          ((TextAreaBehavior)getBehavior()).mousePressed(paramAnonymousMouseEvent);
          paramAnonymousMouseEvent.consume();
        }
      });
      addEventHandler(MouseEvent.MOUSE_RELEASED, new EventHandler()
      {
        public void handle(MouseEvent paramAnonymousMouseEvent)
        {
          ((TextAreaBehavior)getBehavior()).mouseReleased(paramAnonymousMouseEvent);
          paramAnonymousMouseEvent.consume();
        }
      });
      addEventHandler(MouseEvent.MOUSE_DRAGGED, new EventHandler()
      {
        public void handle(MouseEvent paramAnonymousMouseEvent)
        {
          ((TextAreaBehavior)getBehavior()).mouseDragged(paramAnonymousMouseEvent);
          paramAnonymousMouseEvent.consume();
        }
      });
    }
    
    protected ObservableList<Node> getChildren()
    {
      return super.getChildren();
    }
    
    public Orientation getContentBias()
    {
      return Orientation.HORIZONTAL;
    }
    
    protected double computePrefWidth(double paramDouble)
    {
      if (computedPrefWidth < 0.0D)
      {
        Insets localInsets = getInsets();
        double d = 0.0D;
        Object localObject = paragraphNodes.getChildren().iterator();
        while (((Iterator)localObject).hasNext())
        {
          Node localNode = (Node)((Iterator)localObject).next();
          Text localText = (Text)localNode;
          d = Math.max(d, Utils.computeTextWidth(localText.getFont(), localText.getText(), 0.0D));
        }
        d += localInsets.getLeft() + localInsets.getRight();
        localObject = scrollPane.getViewportBounds();
        computedPrefWidth = Math.max(d, localObject != null ? ((Bounds)localObject).getWidth() : 0.0D);
      }
      return computedPrefWidth;
    }
    
    protected double computePrefHeight(double paramDouble)
    {
      if (paramDouble != widthForComputedPrefHeight)
      {
        invalidateMetrics();
        widthForComputedPrefHeight = paramDouble;
      }
      if (computedPrefHeight < 0.0D)
      {
        Insets localInsets = getInsets();
        double d1;
        if (paramDouble == -1.0D) {
          d1 = 0.0D;
        } else {
          d1 = Math.max(paramDouble - (localInsets.getLeft() + localInsets.getRight()), 0.0D);
        }
        double d2 = 0.0D;
        int i = 0;
        Object localObject = paragraphNodes.getChildren().iterator();
        while (((Iterator)localObject).hasNext())
        {
          Node localNode = (Node)((Iterator)localObject).next();
          Text localText = (Text)localNode;
          d2 += Utils.computeTextHeight(localText.getFont(), localText.getText(), d1);
          i++;
        }
        d2 += localInsets.getTop() + localInsets.getBottom();
        localObject = scrollPane.getViewportBounds();
        computedPrefHeight = Math.max(d2, localObject != null ? ((Bounds)localObject).getHeight() : 0.0D);
      }
      return computedPrefHeight;
    }
    
    protected double computeMinWidth(double paramDouble)
    {
      if (computedMinWidth < 0.0D)
      {
        double d = getInsets().getLeft() + getInsets().getRight();
        computedMinWidth = Math.min(characterWidth + d, computePrefWidth(paramDouble));
      }
      return computedMinWidth;
    }
    
    protected double computeMinHeight(double paramDouble)
    {
      if (computedMinHeight < 0.0D)
      {
        double d = getInsets().getTop() + getInsets().getBottom();
        computedMinHeight = Math.min(lineHeight + d, computePrefHeight(paramDouble));
      }
      return computedMinHeight;
    }
    
    public void layoutChildren()
    {
      TextArea localTextArea = (TextArea)getSkinnable();
      double d1 = getWidth();
      Insets localInsets = getInsets();
      double d2 = Math.max(d1 - (localInsets.getLeft() + localInsets.getRight()), 0.0D);
      double d3 = localInsets.getTop();
      Object localObject1 = paragraphNodes.getChildren().iterator();
      while (((Iterator)localObject1).hasNext())
      {
        localObject2 = (Node)((Iterator)localObject1).next();
        Text localText1 = (Text)localObject2;
        localText1.setWrappingWidth(d2);
        Bounds localBounds = localText1.getBoundsInLocal();
        localText1.setLayoutX(localInsets.getLeft());
        localText1.setLayoutY(d3);
        d3 += localBounds.getHeight();
      }
      if (promptNode != null)
      {
        promptNode.setLayoutX(localInsets.getLeft());
        promptNode.setLayoutY(localInsets.getTop() + ((FontMetrics)fontMetrics.get()).getAscent());
        promptNode.setWrappingWidth(d2);
      }
      localObject1 = localTextArea.getSelection();
      Object localObject2 = caretPath.getBoundsInParent();
      selectionHighlightGroup.getChildren().clear();
      int i = localTextArea.getCaretPosition();
      int j = localTextArea.getAnchor();
      Object localObject4;
      if (PlatformUtil.isEmbedded())
      {
        if (((IndexRange)localObject1).getLength() > 0)
        {
          selectionHandle1.resize(selectionHandle1.prefWidth(-1.0D), selectionHandle1.prefHeight(-1.0D));
          selectionHandle2.resize(selectionHandle2.prefWidth(-1.0D), selectionHandle2.prefHeight(-1.0D));
        }
        else
        {
          caretHandle.resize(caretHandle.prefWidth(-1.0D), caretHandle.prefHeight(-1.0D));
        }
        if (((IndexRange)localObject1).getLength() > 0)
        {
          k = paragraphNodes.getChildren().size();
          m = localTextArea.getLength() + 1;
          localObject3 = null;
          do
          {
            localObject3 = (Text)paragraphNodes.getChildren().get(--k);
            m -= ((Text)localObject3).getText().length() + 1;
          } while (j < m);
          ((Text)localObject3).setImpl_caretPosition(j - m);
          caretPath.getElements().clear();
          caretPath.getElements().addAll(((Text)localObject3).getImpl_caretShape());
          caretPath.setLayoutX(((Text)localObject3).getLayoutX());
          caretPath.setLayoutY(((Text)localObject3).getLayoutY());
          localObject4 = caretPath.getBoundsInParent();
          if (i < j)
          {
            selectionHandle2.setLayoutX(((Bounds)localObject4).getMinX() - selectionHandle2.getWidth() / 2.0D);
            selectionHandle2.setLayoutY(((Bounds)localObject4).getMaxY() - 1.0D);
          }
          else
          {
            selectionHandle1.setLayoutX(((Bounds)localObject4).getMinX() - selectionHandle1.getWidth() / 2.0D);
            selectionHandle1.setLayoutY(((Bounds)localObject4).getMinY() - selectionHandle1.getHeight() + 1.0D);
          }
        }
      }
      int k = paragraphNodes.getChildren().size();
      int m = localTextArea.getLength() + 1;
      Object localObject3 = null;
      do
      {
        localObject3 = (Text)paragraphNodes.getChildren().get(--k);
        m -= ((Text)localObject3).getText().length() + 1;
      } while (i < m);
      ((Text)localObject3).setImpl_caretPosition(i - m);
      caretPath.getElements().clear();
      caretPath.getElements().addAll(((Text)localObject3).getImpl_caretShape());
      caretPath.setLayoutX(((Text)localObject3).getLayoutX());
      caretPath.setLayoutY(((Text)localObject3).getLayoutY());
      if ((localObject2 == null) || (!localObject2.equals(caretPath.getBoundsInParent()))) {
        TextAreaSkin.this.scrollCaretToVisible();
      }
      k = ((IndexRange)localObject1).getStart();
      m = ((IndexRange)localObject1).getEnd();
      localObject3 = paragraphNodes.getChildren().iterator();
      while (((Iterator)localObject3).hasNext())
      {
        localObject4 = (Node)((Iterator)localObject3).next();
        Text localText2 = (Text)localObject4;
        int n = localText2.getText().length() + 1;
        if ((m > k) && (k < n))
        {
          localText2.setImpl_selectionStart(k);
          localText2.setImpl_selectionEnd(Math.min(m, n));
          Path localPath = new Path();
          localPath.setManaged(false);
          localPath.setStroke(null);
          PathElement[] arrayOfPathElement = localText2.getImpl_selectionShape();
          if (arrayOfPathElement != null) {
            localPath.getElements().addAll(arrayOfPathElement);
          }
          selectionHighlightGroup.getChildren().add(localPath);
          selectionHighlightGroup.setVisible(true);
          localPath.setLayoutX(localText2.getLayoutX());
          localPath.setLayoutY(localText2.getLayoutY());
          updateHighlightFill();
        }
        else
        {
          localText2.setImpl_selectionStart(-1);
          localText2.setImpl_selectionEnd(-1);
          selectionHighlightGroup.setVisible(false);
        }
        k = Math.max(0, k - n);
        m = Math.max(0, m - n);
      }
      if (PlatformUtil.isEmbedded())
      {
        localObject3 = caretPath.getBoundsInParent();
        if (((IndexRange)localObject1).getLength() > 0)
        {
          if (i < j)
          {
            selectionHandle1.setLayoutX(((Bounds)localObject3).getMinX() - selectionHandle1.getWidth() / 2.0D);
            selectionHandle1.setLayoutY(((Bounds)localObject3).getMinY() - selectionHandle1.getHeight() + 1.0D);
          }
          else
          {
            selectionHandle2.setLayoutX(((Bounds)localObject3).getMinX() - selectionHandle2.getWidth() / 2.0D);
            selectionHandle2.setLayoutY(((Bounds)localObject3).getMaxY() - 1.0D);
          }
        }
        else
        {
          caretHandle.setLayoutX(((Bounds)localObject3).getMinX() - caretHandle.getWidth() / 2.0D + 1.0D);
          caretHandle.setLayoutY(((Bounds)localObject3).getMaxY());
        }
      }
      if ((scrollPane.getPrefViewportWidth() == 0.0D) || (scrollPane.getPrefViewportHeight() == 0.0D))
      {
        TextAreaSkin.this.updatePrefViewportWidth();
        TextAreaSkin.this.updatePrefViewportHeight();
        if (((getParent() != null) && (scrollPane.getPrefViewportWidth() > 0.0D)) || (scrollPane.getPrefViewportHeight() > 0.0D)) {
          getParent().requestLayout();
        }
      }
    }
  }
}

/* Location:
 * Qualified Name:     com.sun.javafx.scene.control.skin.TextAreaSkin
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.javafx.scene.control.skin;

import javafx.beans.property.BooleanProperty;
import javafx.beans.property.BooleanPropertyBase;
import javafx.scene.text.Text;

class TextFieldSkin$1
  extends BooleanPropertyBase
{
  TextFieldSkin$1(TextFieldSkin paramTextFieldSkin) {}
  
  public Object getBean()
  {
    return this$0;
  }
  
  public String getName()
  {
    return "forwardBias";
  }
  
  protected void invalidated()
  {
    if (this$0.getWidth() > 0.0D)
    {
      TextFieldSkin.access$000(this$0).impl_caretBiasProperty().set(get());
      this$0.updateCaretOff();
    }
  }
}

/* Location:
 * Qualified Name:     com.sun.javafx.scene.control.skin.TextFieldSkin.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.javafx.scene.control.skin;

import javafx.beans.Observable;
import javafx.beans.binding.DoubleBinding;
import javafx.geometry.Insets;

class TextFieldSkin$10
  extends DoubleBinding
{
  TextFieldSkin$10(TextFieldSkin paramTextFieldSkin)
  {
    bind(new Observable[] { this$0.heightProperty(), this$0.insets() });
  }
  
  protected double computeValue()
  {
    return this$0.getHeight() - this$0.getInsets().getTop() - this$0.getInsets().getBottom();
  }
}

/* Location:
 * Qualified Name:     com.sun.javafx.scene.control.skin.TextFieldSkin.10
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.javafx.scene.control.skin;

import javafx.beans.Observable;
import javafx.beans.binding.StringBinding;
import javafx.scene.control.TextField;

class TextFieldSkin$11
  extends StringBinding
{
  TextFieldSkin$11(TextFieldSkin paramTextFieldSkin, TextField paramTextField)
  {
    bind(new Observable[] { val$textField.textProperty() });
  }
  
  protected String computeValue()
  {
    String str = this$0.maskText(val$textField.getText());
    return str == null ? "" : str;
  }
}

/* Location:
 * Qualified Name:     com.sun.javafx.scene.control.skin.TextFieldSkin.11
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.javafx.scene.control.skin;

import javafx.beans.Observable;
import javafx.beans.binding.ObjectBinding;
import javafx.beans.property.ObjectProperty;
import javafx.scene.control.TextField;
import javafx.scene.paint.Paint;

class TextFieldSkin$12
  extends ObjectBinding<Paint>
{
  TextFieldSkin$12(TextFieldSkin paramTextFieldSkin, TextField paramTextField)
  {
    bind(new Observable[] { this$0.highlightTextFill, this$0.textFill, val$textField.focusedProperty() });
  }
  
  protected Paint computeValue()
  {
    return val$textField.isFocused() ? (Paint)this$0.highlightTextFill.get() : (Paint)this$0.textFill.get();
  }
}

/* Location:
 * Qualified Name:     com.sun.javafx.scene.control.skin.TextFieldSkin.12
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.javafx.scene.control.skin;

import javafx.beans.InvalidationListener;
import javafx.beans.Observable;

class TextFieldSkin$13
  implements InvalidationListener
{
  TextFieldSkin$13(TextFieldSkin paramTextFieldSkin) {}
  
  public void invalidated(Observable paramObservable)
  {
    TextFieldSkin.access$400(this$0);
  }
}

/* Location:
 * Qualified Name:     com.sun.javafx.scene.control.skin.TextFieldSkin.13
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.javafx.scene.control.skin;

import javafx.beans.InvalidationListener;
import javafx.beans.Observable;

class TextFieldSkin$14
  implements InvalidationListener
{
  TextFieldSkin$14(TextFieldSkin paramTextFieldSkin) {}
  
  public void invalidated(Observable paramObservable)
  {
    TextFieldSkin.access$400(this$0);
  }
}

/* Location:
 * Qualified Name:     com.sun.javafx.scene.control.skin.TextFieldSkin.14
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package com.sun.javafx.scene.control.skin;

import javafx.beans.InvalidationListener;
import javafx.beans.Observable;
import javafx.beans.property.ObjectProperty;
import javafx.collections.Observable
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd