Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sbellus committed Feb 4, 2016
1 parent b273e8d commit c7a1488
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 18 deletions.
Expand Up @@ -61,7 +61,7 @@ public String getAlignment() {
return alignment;
}

public void ReadFromLine(String line) {
public void readFromLine(String line) {
Pattern pattern = Pattern.compile("[ \t]*(\".*\")?[ \t]*(l|r|c)?[ \t]*([0-9]+)?[ \t]*([0-9]+)?");
Matcher matcher = pattern.matcher(line);
if (matcher.matches()) {
Expand All @@ -84,7 +84,7 @@ public void ReadFromLine(String line) {
}
}

public void ReadFromSymbol(Symbol symbol) {
public void readFromSymbol(Symbol symbol) {
if (symbol.hasProperty(SymbolPropertyWidht)) {
width = Integer.parseInt(symbol.getProperty(SymbolPropertyWidht));
}
Expand All @@ -99,7 +99,7 @@ public void ReadFromSymbol(Symbol symbol) {
}
}

public void WriteToSymbol(Symbol symbol) {
public void writeToSymbol(Symbol symbol) {
if (width != null) {
symbol.putProperty(SymbolPropertyWidht, width.toString());
}
Expand Down
Expand Up @@ -19,14 +19,14 @@ public GraphicsSvg() {
this.properties = new GraphicsProperties();
}

public void ReadFromSymbol(Symbol symbol) {
public void readFromSymbol(Symbol symbol) {
svg = symbol.getProperty(SymbolPropertySvg);
properties.ReadFromSymbol(symbol);
properties.readFromSymbol(symbol);
}

public void WriteToSymbol(Symbol symbol) {
public void writeToSymbol(Symbol symbol) {
symbol.putProperty(SymbolPropertySvg, svg);
properties.WriteToSymbol(symbol);
properties.writeToSymbol(symbol);
}

public String toHtml() {
Expand Down
Expand Up @@ -28,10 +28,10 @@ public Maybe<Symbol> parse(Symbol current, Parser parser) {

try {
GraphicsWiki wikiGraphics = new GraphicsWiki(specifier);
wikiGraphics.ParseFromWiki(parser);
wikiGraphics.parseFromWiki(parser);
wikiGraphics.replaceVariables(new GraphicsVariableReplacer(parser.getVariableSource()));
GraphicsSvg svgGraphics = convertor.convert(wikiGraphics);
svgGraphics.WriteToSymbol(current);
svgGraphics.writeToSymbol(current);
} catch (Exception exception) {
Symbol error = new Symbol(new Preformat(), "").add(exception.getLocalizedMessage());
return new Maybe<Symbol>(error);
Expand All @@ -42,7 +42,7 @@ public Maybe<Symbol> parse(Symbol current, Parser parser) {

public String toTarget(Translator translator, Symbol symbol) {
GraphicsSvg svgGraphics = new GraphicsSvg();
svgGraphics.ReadFromSymbol(symbol);
svgGraphics.readFromSymbol(symbol);
return svgGraphics.toHtml();
}
}
Expand Up @@ -21,7 +21,7 @@ public String replaceVariablesIn(String str) {
return replaceVariablesRecursively(str);
}

public String replaceVariablesRecursively(String str) {
private String replaceVariablesRecursively(String str) {
boolean isAtLeastOneVariableReplaced = false;
java.util.regex.Matcher m = VariablePattern.matcher(str);
while (m.find()) {
Expand All @@ -40,5 +40,4 @@ public String replaceVariablesRecursively(String str) {

return str;
}

}
Expand Up @@ -18,7 +18,7 @@ public GraphicsWiki(String specifier) {
this.specifier = specifier;
}

public void ParseFromWiki(Parser parser) throws GraphicsWikiParserException {
public void parseFromWiki(Parser parser) throws GraphicsWikiParserException {

String propertiesText = parser.parseToAsString(SymbolType.Newline).getValue();
if (parser.atEnd()) {
Expand All @@ -34,7 +34,7 @@ public void ParseFromWiki(Parser parser) throws GraphicsWikiParserException {
throw new GraphicsWikiParserException("No content for " + specifier);
}

properties.ReadFromLine(propertiesText);
properties.readFromLine(propertiesText);
}

public void replaceVariables(GraphicsVariableReplacer replacer) {
Expand Down
@@ -1,10 +1,6 @@
package com.github.sbellus.fitnesse.plantuml.graphics;

public class GraphicsWikiToSvgConvertionException extends Exception {

/**
*
*/
private static final long serialVersionUID = 1L;

public GraphicsWikiToSvgConvertionException(String message) {
Expand Down

0 comments on commit c7a1488

Please sign in to comment.