Skip to content

Commit

Permalink
auto code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
hrj committed Jan 7, 2015
1 parent b398eb4 commit b3c48cb
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ protected void applyStyle(final int availWidth, final int availHeight) {
final Integer declaredWidth = this.getDeclaredWidth(rs, actualAvailWidth);
final Integer declaredHeight = this.getDeclaredHeight(rs, actualAvailHeight);
// TODO: Get rid of autoMarginX and autoMarginY. They will be always zero
int autoMarginX = 0, autoMarginY = 0;
final int autoMarginX = 0, autoMarginY = 0;
this.borderInsets = borderInsets;
if (isRootBlock) {
// In the root block, the margin behaves like an extra padding.
Expand Down Expand Up @@ -515,7 +515,7 @@ protected Dimension applyAutoStyles(final int availWidth, final int availHeight)
if (rootElement == null) {
return null;
}
Dimension changes = new Dimension();
final Dimension changes = new Dimension();
final RenderState rs = rootElement.getRenderState();
if (rs == null) {
throw new IllegalStateException("Element without render state: " + rootElement + "; parent=" + rootElement.getParentNode());
Expand Down Expand Up @@ -848,19 +848,19 @@ private Insets getInsets(final boolean hscroll, final boolean vscroll,
int bottom = 0;
int left = 0;
int right = 0;
if (includeMI && mi != null) {
if (includeMI && (mi != null)) {
top += mi.top;
left += mi.left;
bottom += mi.bottom;
right += mi.right;
}
if (includeBI && bi != null) {
if (includeBI && (bi != null)) {
top += bi.top;
left += bi.left;
bottom += bi.bottom;
right += bi.right;
}
if (includePI && pi != null) {
if (includePI && (pi != null)) {
top += pi.top;
left += pi.left;
bottom += pi.bottom;
Expand Down
3 changes: 2 additions & 1 deletion src/HTML_Renderer/org/lobobrowser/html/renderer/RBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,8 @@ public final void doLayout(final int availWidth, final int availHeight, final bo
this.doLayout(availWidth, availHeight, true, false, null, this.defaultOverflowX, this.defaultOverflowY, sizeOnly);
}

public void doLayout(int availWidth, int availHeight, boolean expand, boolean sizeOnly) {
@Override
public void doLayout(final int availWidth, final int availHeight, final boolean expand, final boolean sizeOnly) {
this.doLayout(availWidth, availHeight, expand, expand, null, this.defaultOverflowX, this.defaultOverflowY, sizeOnly);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1602,7 +1602,7 @@ private final void layoutFloat(final BoundableRenderable renderable, final boole
final RElement e = (RElement) renderable;
e.layout(availWidth, availHeight, this.sizeOnly);
} else if (renderable instanceof RRelative) {
RRelative rRelative = (RRelative) renderable;
final RRelative rRelative = (RRelative) renderable;
rRelative.layout(availWidth, availHeight, this.sizeOnly);
} else {
// TODO Check other types of renderabls
Expand Down Expand Up @@ -2620,7 +2620,7 @@ private void placeFloat(final BoundableRenderable element, final int y, final bo
}
break;
}
if ((desiredWidth <= 0) || boxWidth <= (desiredWidth - rightOffset - leftOffset)) {
if ((desiredWidth <= 0) || (boxWidth <= (desiredWidth - rightOffset - leftOffset))) {
// Size is fine.
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public Component addComponent(final Component component) {
}

@Override
protected void doLayout(int availWidth, int availHeight, boolean expand, boolean sizeOnly) {
protected void doLayout(final int availWidth, final int availHeight, final boolean expand, final boolean sizeOnly) {
this.child.doLayout(availWidth, availHeight, expand, expand, null, 0, 0, sizeOnly, true);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public void paint(final Graphics g) {
}


public void layout(int availWidth, int availHeight, boolean sizeOnly) {
public void layout(final int availWidth, final int availHeight, final boolean sizeOnly) {
child.layout(availWidth, availHeight, false, sizeOnly);
assignDimension();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ public LayoutValue(final int width, final int height) {
}

@Override
protected void doLayout(int availWidth, int availHeight, boolean expand, boolean sizeOnly) {
protected void doLayout(final int availWidth, final int availHeight, final boolean expand, final boolean sizeOnly) {
// TODO: Is it okay to ignore `expand`?
doLayout(availWidth, availHeight, sizeOnly);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ public LayoutValue(final int width, final int height) {
}

@Override
protected void doLayout(int availWidth, int availHeight, boolean expand, boolean sizeOnly) {
protected void doLayout(final int availWidth, final int availHeight, final boolean expand, final boolean sizeOnly) {
// TODO: Is it okay to ignore `expand`?
doLayout(availWidth, availHeight, sizeOnly);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Platform_Core/org/lobobrowser/main/PlatformInit.java
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public void initLookAndFeel() throws Exception {
// Set appropriate Swing L&F
boolean nimbusApplied = false;
try {
for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
for (final LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
UIManager.setLookAndFeel(info.getClassName());
nimbusApplied = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ private boolean populatePopupForElement(final HTMLElement element, final JPopupM
boolean imageEntryAdded = false;
Node currElement = element;
while (currElement != null) {
if ((!linkEntryAdded) && currElement instanceof HTMLLinkElementImpl) {
if ((!linkEntryAdded) && (currElement instanceof HTMLLinkElementImpl)) {
final HTMLLinkElementImpl link = (HTMLLinkElementImpl) currElement;
final JMenuItem openLinkMenuItem = new JMenuItem("Open link in new window");
openLinkMenuItem.addActionListener(e -> {
Expand All @@ -392,7 +392,7 @@ private boolean populatePopupForElement(final HTMLElement element, final JPopupM
popupMenu.add(copyLinkMenuItem);

linkEntryAdded = true;
} else if ((!imageEntryAdded) && currElement instanceof HTMLImageElementImpl) {
} else if ((!imageEntryAdded) && (currElement instanceof HTMLImageElementImpl)) {
final HTMLImageElementImpl img = (HTMLImageElementImpl) currElement;
try {
final URL srcUrl = img.getFullURL(img.getSrc());
Expand Down

0 comments on commit b3c48cb

Please sign in to comment.