Added Javadoc requested by @delvh

This commit is contained in:
Kai S. K. Engelbart 2019-12-18 22:07:05 +01:00
parent 69153005cd
commit 500555c8db
3 changed files with 132 additions and 100 deletions

View File

@ -31,7 +31,7 @@ public class PrimaryButton extends JButton {
* Creates a primary button
*
* @param title the title of the button
* @param the size of the arc used to draw the round button edges
* @param arcSize the size of the arc used to draw the round button edges
* @since Envoy 0.2-alpha
*/
public PrimaryButton(String title, int arcSize) {

View File

@ -31,6 +31,17 @@ public class PrimaryScrollBar extends BasicScrollBarUI {
private final Color draggingColor;
private final boolean isVertical;
/**
* Initializes a {@link PrimaryScrollBar} with a color scheme.
*
* @param arcSize the size of the arc used to draw the round scroll bar
* edges
* @param scrollBarColor the default color
* @param hoverColor the color while hovering
* @param draggingColor the color while dragging
* @param isVertical indicates whether this is a vertical
* {@link PrimaryScrollBar}
*/
public PrimaryScrollBar(int arcSize, Color scrollBarColor, Color hoverColor, Color draggingColor, boolean isVertical) {
this.arcSize = arcSize;
this.scrollBarColor = scrollBarColor;
@ -39,6 +50,15 @@ public class PrimaryScrollBar extends BasicScrollBarUI {
this.isVertical = isVertical;
}
/**
* Initializes a {@link PrimaryScrollBar} using a color scheme specified in a
* {@link Theme}
*
* @param theme the {@link Theme} to be applied to this
* {@link PrimaryScrollBar}
* @param isVertical indicates whether this is a vertical
* {@link PrimaryScrollBar}
*/
public PrimaryScrollBar(Theme theme, boolean isVertical) {
this(5, theme.getInteractableBackgroundColor(), new Color(theme.getInteractableBackgroundColor().getRGB() - 50),
new Color(theme.getInteractableBackgroundColor().getRGB() + 170), isVertical);

View File

@ -17,6 +17,11 @@ public class PrimaryScrollPane extends JScrollPane {
private int verticalScrollBarMaximum = getVerticalScrollBar().getMaximum();
private boolean chatOpened = false;
/**
* Initializes a {@link JScrollPane} with the primary Envoy design scheme
*
* @since Envoy v0.2-alpha
*/
public PrimaryScrollPane() { setBorder(null); }
/**
@ -67,5 +72,12 @@ public class PrimaryScrollPane extends JScrollPane {
});
}
/**
* Indicates a chat being opened by the user to this {@link PrimaryScrollPane}
* triggering it to automatically scroll down.
*
* @param chatOpened indicates the chat opening status
* @since Envoy v0.2-alpha
*/
public void setChatOpened(boolean chatOpened) { this.chatOpened = chatOpened; }
}