Skip to content

Commit

Permalink
Checkstyle: LineLength
Browse files Browse the repository at this point in the history
  • Loading branch information
aterai committed Oct 24, 2018
1 parent a9707ab commit 89957e1
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 14 deletions.
3 changes: 2 additions & 1 deletion DnDBetweenTrees/src/java/example/MainPanel.java
Expand Up @@ -70,7 +70,8 @@ public static void createAndShowGui() {
}

class TreeTransferHandler extends TransferHandler {
// protected static final DataFlavor FLAVOR = new ActivationDataFlavor(DefaultMutableTreeNode[].class, DataFlavor.javaJVMLocalObjectMimeType, "Array of TreeNode");
// protected static final DataFlavor FLAVOR = new ActivationDataFlavor(
// DefaultMutableTreeNode[].class, DataFlavor.javaJVMLocalObjectMimeType, "Array of TreeNode");
protected static final DataFlavor FLAVOR = new DataFlavor(DefaultMutableTreeNode[].class, "Array of DefaultMutableTreeNode");
protected JTree source;

Expand Down
3 changes: 2 additions & 1 deletion DnDList/src/java/example/MainPanel.java
Expand Up @@ -87,7 +87,8 @@ class DnDList<E> extends JList<E> implements DragGestureListener, Transferable {
protected DnDList() {
super();
new DropTarget(this, DnDConstants.ACTION_COPY_OR_MOVE, new CDropTargetListener(), true);
DragSource.getDefaultDragSource().createDefaultDragGestureRecognizer((Component) this, DnDConstants.ACTION_COPY_OR_MOVE, (DragGestureListener) this);
DragSource.getDefaultDragSource().createDefaultDragGestureRecognizer(
(Component) this, DnDConstants.ACTION_COPY_OR_MOVE, (DragGestureListener) this);
}
@Override protected void paintComponent(Graphics g) {
super.paintComponent(g);
Expand Down
3 changes: 2 additions & 1 deletion DnDTable/src/java/example/MainPanel.java
Expand Up @@ -125,7 +125,8 @@ protected DnDTable(TableModel model) {
super(model);
// DropTarget dropTarget =
new DropTarget(this, DnDConstants.ACTION_COPY_OR_MOVE, new CDropTargetListener(), true);
DragSource.getDefaultDragSource().createDefaultDragGestureRecognizer((Component) this, DnDConstants.ACTION_COPY_OR_MOVE, (DragGestureListener) this);
DragSource.getDefaultDragSource().createDefaultDragGestureRecognizer(
(Component) this, DnDConstants.ACTION_COPY_OR_MOVE, (DragGestureListener) this);
}
@Override protected void paintComponent(Graphics g) {
super.paintComponent(g);
Expand Down
21 changes: 12 additions & 9 deletions HtmlTableBorderStyle/src/java/example/MainPanel.java
Expand Up @@ -6,15 +6,18 @@
import javax.swing.*;

public final class MainPanel extends JPanel {
public static final String TD1 = "<td style='background-color:white;border-right:1px solid green;border-top:1px solid blue'>aaaaaaaaaaaaaaa</td>";
public static final String TABLE_STYLE1 = "style='border-left:1px solid red;border-bottom:1px solid red;background-color:yellow' cellspacing='0px' cellpadding='5px'";
public static final String TD1 = "<td style='background-color:white;border-right:1px solid green;border-top:1px solid blue'>aaaaaaaaaa</td>";
public static final String TABLE_STYLE1 = "style='border-left:1px solid red;border-bottom:1px solid red;background-color:yellow'";
public static final String TABLE_CELLPD1 = " cellspacing='0px' cellpadding='5px'";

public static final String TD2 = "<td style='background-color:white;border-right:1px solid green;border-bottom:1px solid blue'>aaaaaaaaaaaaaaa</td>";
public static final String TABLE_STYLE2 = "style='border-left:1px solid red;border-top:1px solid red;background-color:yellow' cellspacing='0px' cellpadding='5px'";
public static final String TD2 = "<td style='background-color:white;border-right:1px solid green;border-bottom:1px solid blue'>aaaaaaaaaa</td>";
public static final String TABLE_STYLE2 = "style='border-left:1px solid red;border-top:1px solid red;background-color:yellow'";
public static final String TABLE_CELLPD2 = " cellspacing='0px' cellpadding='5px'";

// https://stackoverflow.com/questions/3355469/1-pixel-table-border-in-jtextpane-using-html
public static final String TD3 = "<td style='background-color:white'>aaaaaaaaaaaaaaa</td>";
public static final String TABLE_STYLE3 = "style='border:0px;background-color:red' cellspacing='1px' cellpadding='5px'";
public static final String TD3 = "<td style='background-color:white'>aaaaaaaaaa</td>";
public static final String TABLE_STYLE3 = "style='border:0px;background-color:red'";
public static final String TABLE_CELLPD3 = " cellspacing='1px' cellpadding='5px'";

private MainPanel() {
super();
Expand All @@ -27,9 +30,9 @@ private MainPanel() {
// border:1px solid #ccc;
// }

String html1 = "<html><table " + TABLE_STYLE1 + ">" + "<tr>" + TD1 + TD1 + "</tr><tr>" + TD1 + TD1 + "</tr></table>";
String html2 = "<html><table " + TABLE_STYLE2 + ">" + "<tr>" + TD2 + TD2 + "</tr><tr>" + TD2 + TD2 + "</tr></table>";
String html3 = "<html><table " + TABLE_STYLE3 + ">" + "<tr>" + TD3 + TD3 + "</tr><tr>" + TD3 + TD3 + "</tr></table>";
String html1 = "<html><table " + TABLE_STYLE1 + TABLE_CELLPD1 + ">" + "<tr>" + TD1 + TD1 + "</tr><tr>" + TD1 + TD1 + "</tr></table>";
String html2 = "<html><table " + TABLE_STYLE2 + TABLE_CELLPD2 + ">" + "<tr>" + TD2 + TD2 + "</tr><tr>" + TD2 + TD2 + "</tr></table>";
String html3 = "<html><table " + TABLE_STYLE3 + TABLE_CELLPD3 + ">" + "<tr>" + TD3 + TD3 + "</tr><tr>" + TD3 + TD3 + "</tr></table>";

add(makeTitledPanel("border-left, border-bottom", new JLabel(html1)));
add(makeTitledPanel("border-left, border-top", new JLabel(html2)));
Expand Down
4 changes: 2 additions & 2 deletions checks.xml
Expand Up @@ -212,8 +212,8 @@
<property name="allowNonPrintableEscapes" value="true"/>
</module>
<module name="LineLength">
<property name="max" value="170"/>
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://|throws|@Override.*"/>
<property name="max" value="165"/>
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://|throws|@Override.*|&lt;html"/>
</module>
<!-- module name="AvoidStarImport"/ -->
<!-- module name="OneTopLevelClass"/ -->
Expand Down

0 comments on commit 89957e1

Please sign in to comment.