[phpBB Debug] PHP Notice: in file /viewtopic.php on line 988: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_Angeles' for 'PDT/-7.0/DST' instead
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 988: getdate(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_Angeles' for 'PDT/-7.0/DST' instead
www.ephesoft.com/forums • View topic - [resolved] API question: imageOverlay for client-side

[resolved] API question: imageOverlay for client-side

General discussion about the Ephesoft architecture at a high-level

[resolved] API question: imageOverlay for client-side

Postby dhartford » Wed Jun 15, 2011 5:47 am

Hey all,
I'm trying to put together a proof-of-concept for manual tabular entry, where a critical part is row highlighting in the image so the keyer does not loose track of their current line item.

Unfortunately, I'm missing some part of how the imageOverlay works -- the following code snippets do not seem to provide shading/overlay (which are all client-side in the gwt.rv.client.view package), with a button added to the UIBinder to trigger the example code (and I have additional debugging code in place to confirm the button is working).

Simple attempt to just create a shaded area:
Code: Select all

public void drawoverlaybox(){
ReviewValidateView myview =  this.presenter.getView();
ImageOverlayPanel iop =  myview.imgOverlayPanel;

//draw a big box in the center area that is not outside the x/y boundaries of the test images
//requires gwt-java-math sources jar (NOT gwt-math) and adjustment to .gwt.xml to import package for
//BigInteger/BigDecimal support. Well, at least until upgraded to GWT 2.2 or greater.
   Coordinates baseline = new Coordinates();
      baseline.setX0(BigInteger.valueOf(300));
      baseline.setX1(BigInteger.valueOf(1000));
      baseline.setY0(BigInteger.valueOf(500));
      baseline.setY1(BigInteger.valueOf(1000));

      List<Coordinates> xy = new ArrayList<Coordinates>();
      xy.add(baseline);
      iop.processOverlay(xy, 0,0,1.0f);
}



Instead of direct overlay manipulation, make some table row/columns with predefined coordinates (the true intent, a new button called 'Guided Table'):
Code: Select all
.....
//modified insertDeleteRow method in TableExtractionView....
   Coordinates baseline = new Coordinates();
      baseline.setX0(BigInteger.valueOf(300));
      baseline.setX1(BigInteger.valueOf(1000));
      baseline.setY0(BigInteger.valueOf(500));
      baseline.setY1(BigInteger.valueOf(1000));

//modified createNewRow to ensure coordinates are not nulled if provided
for (Iterator iterator = columnList.iterator(); iterator.hasNext();) {
   Column column = (Column) iterator.next();
    column.setCoordinates(baseline);
}
row = createNewRow(columnList);
row.setRowCoordinates(baseline);


Neither of these scenarios seem to modify the overlay, is there something I'm missing? I admit I do not usually work on the eventbuses on the GUI side, so I may be missing something there. Normal overlay support (even on the table side) is working fine.

UPDATE: still no success, but I've tried several focusHandler events, I suspect maybe I'm missing something there. I'm not quite sure I know the difference between my manually created row/columns, and the ones that have been loaded from normal TableExtraction code. I did change from TextBox to a DocField w/ coordinates and using GWTValidatableControl.createGWTControl for a SuggestBox instead, but I'm still missing something.

(EDIT: this may be better served in the Integrator forum)

Thanks!
-Darren
Last edited by dhartford on Mon Jun 20, 2011 12:33 pm, edited 1 time in total.
dhartford
 
Posts: 124
Joined: Tue Mar 29, 2011 9:46 am
Location: Maine, USA

Re: API question: imageOverlay for client-side only interact

Postby dhartford » Fri Jun 17, 2011 6:03 am

Update 2 - I'm really stuck and would like some other eyes on this challenge - I was hoping to be further along before this weekend and have this weekend just be applying this functionality to the business problem (instead of just figuring out how to use this functionality)

I'm using the focusHandler and calling fireEvent(new ValidationFieldChangeEvent(field)) on each column (ValidatableWidget<SuggestBox>) created. I would think this is where it would trigger overlay changes.

I've also gone out of my way to add the newly created widgets to the ValidatePanel 'docFieldWidgets' private list in case the reason why TableView isn't working is because I needed to add it to this list (and then doing a 'setCurrent' for that docFieldWidget in the focus handler, and doing that before the fireEvents).


The two examples above are the two pieces of functionality I'm looking for:
1) (less important) direct overlay drawing feature for when setting up 'table' layout/positioning.
2) per-column shading/overlay change based on the defined coordinates (existing functionality, but for manually created table columns instead of those from the document/ocr detection).
usecase/purpose: viewtopic.php?f=19&t=96




UPDATE 3: breakthrough, my own problems in reading the code left assumptions that were poor - List<Column> columnList almost always represent the ColumnHeaders, and not the columns going to/from a new row.
dhartford
 
Posts: 124
Joined: Tue Mar 29, 2011 9:46 am
Location: Maine, USA


Return to High-Level Architecture Discussion

Who is online

Users browsing this forum: No registered users and 1 guest