[brailleblaster] push by john.bo...@xxxxxxxxxxxxxxxxx - Adding indevelopment package for developing final semantics and style ... on 2012-10-24 19:15 GMT

  • From: brailleblaster@xxxxxxxxxxxxxx
  • To: brailleblaster@xxxxxxxxxxxxx
  • Date: Wed, 24 Oct 2012 19:15:40 +0000

Revision: 36663f06b6ff
Branch:   default
Author:   John Boyer <john.boyer@xxxxxxxxxxxxxxxxx>
Date:     Wed Oct 24 12:14:42 2012
Log: Adding indevelopment package for developing final semantics and style handling
http://code.google.com/p/brailleblaster/source/detail?r=36663f06b6ff

Added:
 /src/main/org/brailleblaster/indevelopment/Semantics.java
 /src/main/org/brailleblaster/indevelopment/Styles.java

=======================================
--- /dev/null
+++ /src/main/org/brailleblaster/indevelopment/Semantics.java Wed Oct 24 12:14:42 2012
@@ -0,0 +1,74 @@
+/* BrailleBlaster Braille Transcription Application
+  *
+  * Copyright (C) 2010, 2012
+  * ViewPlus Technologies, Inc. www.viewplus.com
+  * and
+  * Abilitiessoft, Inc. www.abilitiessoft.com
+  * and
+  * American Printing House for the Blind, Inc. www.aph.org
+  *
+  * All rights reserved
+  *
+  * This file may contain code borrowed from files produced by various
+  * Java development teams. These are gratefully acknoledged.
+  *
+  * This file is free software; you can redistribute it and/or modify it
+  * under the terms of the Apache 2.0 License, as given at
+  * http://www.apache.org/licenses/
+  *
+  * This file is distributed in the hope that it will be useful, but
+  * WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE
+  * See the Apache 2.0 License for more details.
+  *
+  * You should have received a copy of the Apache 2.0 License along with
+  * this program; see the file LICENSE.
+  * If not, see
+  * http://www.apache.org/licenses/
+  *
+  * Maintained by John J. Boyer john.boyer@xxxxxxxxxxxxxxxxx
+*/
+
+package indevelopment;
+
+public class Semantics {
+enum Action {
+  no,
+  skip,
+  generic,
+  cdata,
+  htmlLink,
+  htmlTarget,
+  noTranslate,
+  attrToText,
+  runningHead,
+  footer,
+  boxLine,
+  italic,
+  bold,
+  underline,
+  compbrl,
+  lineSpacing,
+  blankLine,
+  softReturn,
+  newPage,
+  brl,
+  music,
+  math,
+  chemistry,
+  graphic
+};
+
+class SemanticEntry {
+  String markup;
+  String operation;
+  String operand;
+  String parameters;
+  Action action;
+  Styles.StyleType style;
+  String macro;
+}
+
+SemanticEntry[] semanticTable = new SemanticEntry[100];
+
+}
=======================================
--- /dev/null
+++ /src/main/org/brailleblaster/indevelopment/Styles.java Wed Oct 24 12:14:42 2012
@@ -0,0 +1,116 @@
+/* BrailleBlaster Braille Transcription Application
+  *
+  * Copyright (C) 2010, 2012
+  * ViewPlus Technologies, Inc. www.viewplus.com
+  * and
+  * Abilitiessoft, Inc. www.abilitiessoft.com
+  * and
+  * American Printing House for the Blind, Inc. www.aph.org
+  *
+  * All rights reserved
+  *
+  * This file may contain code borrowed from files produced by various
+  * Java development teams. These are gratefully acknoledged.
+  *
+  * This file is free software; you can redistribute it and/or modify it
+  * under the terms of the Apache 2.0 License, as given at
+  * http://www.apache.org/licenses/
+  *
+  * This file is distributed in the hope that it will be useful, but
+  * WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE
+  * See the Apache 2.0 License for more details.
+  *
+  * You should have received a copy of the Apache 2.0 License along with
+  * this program; see the file LICENSE.
+  * If not, see
+  * http://www.apache.org/licenses/
+  *
+  * Maintained by John J. Boyer john.boyer@xxxxxxxxxxxxxxxxx
+*/
+
+package indevelopment;
+
+import nu.xom.Element;
+
+public class Styles {
+
+String[] reservedStyles = {
+  "document",
+  "para",
+  "heading1",
+  "heading2",
+  "heading3",
+  "heading4",
+  "heading5",
+  "heading6",
+  "heading7",
+  "heading8",
+  "heading9",
+  "heading10",
+  "contentsHeader",
+  "contents1",
+  "contents2",
+  "contents3",
+  "contents4",
+  "conents5",
+  "contents6",
+  "contents7",
+  "contents8",
+  "contents9",
+  "contents10"
+  };
+
+enum StyleFormat {
+  inherit,
+  leftJustified,
+  rightJustified,
+  centered,
+  alignColumnsLeft,
+  alignColumnsRight,
+  listColumns,
+  listLines,
+  computerCoded,
+  contents
+};
+
+enum StyleStatus {
+  error,
+  beforeBody,
+  startBody,
+  resumeBody,
+  bodyInterrupted,
+  afterBody,
+};
+
+class StyleType {
+  int linesBefore;
+  int linesAfter;
+  int leftMargin;
+  int rightMargin;
+  boolean keepWithNext;
+  boolean dontSplit;
+  boolean orphanControl;
+  int firstLineIndent;
+  StyleFormat format;
+  boolean newPageBefore;
+  boolean newPageAfter;
+}
+
+class StyleRecord {
+  StyleType style;
+  StyleStatus status;
+  StyleFormat curStyleFormat;
+  Element curElement;
+  int curLeftMargin;
+  int curRightMargin;
+  int curFirstLineIndent;
+}
+
+StyleRecord[] stack = new StyleRecord[20];
+
+public void applyStyle (String style, String text) {
+}
+
+}
+

Other related posts: