tecgraf.javautils.gui.field
Class LatLongDocument

java.lang.Object
  extended by javax.swing.text.AbstractDocument
      extended by javax.swing.text.PlainDocument
          extended by tecgraf.javautils.gui.field.RegexDocument
              extended by tecgraf.javautils.gui.field.LatLongDocument
All Implemented Interfaces:
Serializable, Document

public class LatLongDocument
extends RegexDocument

Campo para Latitude ou Longitude. Escolhe Latitude ou Longitude, exibir efeito visual em caso de valor errado, representar hemisfério via sinal de negativo e casas decimais para os segundos

See Also:
Serialized Form

Nested Class Summary
static class LatLongDocument.Orientation
           
 
Nested classes/interfaces inherited from class javax.swing.text.AbstractDocument
AbstractDocument.AbstractElement, AbstractDocument.AttributeContext, AbstractDocument.BranchElement, AbstractDocument.Content, AbstractDocument.DefaultDocumentEvent, AbstractDocument.ElementEdit, AbstractDocument.LeafElement
 
Field Summary
 
Fields inherited from class javax.swing.text.PlainDocument
lineLimitAttribute, tabSizeAttribute
 
Fields inherited from class javax.swing.text.AbstractDocument
BAD_LOCATION, BidiElementName, ContentElementName, ElementNameAttribute, listenerList, ParagraphElementName, SectionElementName
 
Fields inherited from interface javax.swing.text.Document
StreamDescriptionProperty, TitleProperty
 
Constructor Summary
LatLongDocument(LatLongDocument.Orientation orientation)
          Default: exibir erro em validação desligado ; quantidade de casas decimais para segundos é 2 ; representando hemisfério via sinal de negativo
LatLongDocument(LatLongDocument.Orientation orientation, boolean hemisphereEnabled)
          Default: quantidade de casas decimais para segundos é 2
LatLongDocument(LatLongDocument.Orientation orientation, int decimal)
          Default: exibir erro em validação é false ; representando hemisfério via sinal de negativo
LatLongDocument(LatLongDocument.Orientation orientation, int decimal, boolean hemisphereEnabled)
          Construtor
 
Method Summary
 Integer getDegree()
          Retorna o grau
 Integer getMinute()
          Retorna os minutos
 Float getSecond()
          Retorna os segundos.
protected  Object getValue()
          Obtém o valor atual
 boolean isHemisphereEnabled()
           
 boolean isValid()
           
protected  void rebuildCompleText()
           
 void setAutoComplete(boolean complete)
          Ativa o auto complemento de texto.
 void setDecimal(int decimal)
          Seta a quantidade de casas decimais para os segundos, o mínimo é 1 casa decimal
 
Methods inherited from class tecgraf.javautils.gui.field.RegexDocument
fireAllListeners, getCompleteText, insertString, remove, setCompleteText
 
Methods inherited from class javax.swing.text.PlainDocument
createDefaultRoot, getDefaultRootElement, getParagraphElement, insertUpdate, removeUpdate
 
Methods inherited from class javax.swing.text.AbstractDocument
addDocumentListener, addUndoableEditListener, createBranchElement, createLeafElement, createPosition, dump, fireChangedUpdate, fireInsertUpdate, fireRemoveUpdate, fireUndoableEditUpdate, getAsynchronousLoadPriority, getAttributeContext, getBidiRootElement, getContent, getCurrentWriter, getDocumentFilter, getDocumentListeners, getDocumentProperties, getEndPosition, getLength, getListeners, getProperty, getRootElements, getStartPosition, getText, getText, getUndoableEditListeners, postRemoveUpdate, putProperty, readLock, readUnlock, removeDocumentListener, removeUndoableEditListener, render, replace, setAsynchronousLoadPriority, setDocumentFilter, setDocumentProperties, writeLock, writeUnlock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LatLongDocument

public LatLongDocument(LatLongDocument.Orientation orientation)
Default: exibir erro em validação desligado ; quantidade de casas decimais para segundos é 2 ; representando hemisfério via sinal de negativo

Parameters:
orientation -

LatLongDocument

public LatLongDocument(LatLongDocument.Orientation orientation,
                       int decimal)
Default: exibir erro em validação é false ; representando hemisfério via sinal de negativo

Parameters:
orientation -
decimal - quantidade de casas decimais para segundos

LatLongDocument

public LatLongDocument(LatLongDocument.Orientation orientation,
                       boolean hemisphereEnabled)
Default: quantidade de casas decimais para segundos é 2

Parameters:
orientation -
showValidation - exibir erro em validação
hemisphereEnabled - representar hemisfério via sinal de negativo

LatLongDocument

public LatLongDocument(LatLongDocument.Orientation orientation,
                       int decimal,
                       boolean hemisphereEnabled)
Construtor

Parameters:
orientation - LatLongDocument.Orientation
decimal - quantidade de casas decimais para segundos
hemisphereEnabled - representar hemisfério via sinal de negativo
Method Detail

rebuildCompleText

protected void rebuildCompleText()

setAutoComplete

public void setAutoComplete(boolean complete)
Ativa o auto complemento de texto. Complementa com : após o grau e minutos e com . para os decimais dos segundos

Parameters:
complete -

isValid

public boolean isValid()

setDecimal

public void setDecimal(int decimal)
Seta a quantidade de casas decimais para os segundos, o mínimo é 1 casa decimal

Parameters:
decimal -

getDegree

public Integer getDegree()
Retorna o grau

Returns:
null caso ainda não tenha sido digitado ou não seja válido

getMinute

public Integer getMinute()
Retorna os minutos

Returns:
null caso ainda não tenha sido digitado ou não seja válido

getSecond

public Float getSecond()
Retorna os segundos.

Returns:
null caso ainda não tenha sido digitado ou não seja válido

isHemisphereEnabled

public boolean isHemisphereEnabled()

getValue

protected Object getValue()
Description copied from class: RegexDocument
Obtém o valor atual

Specified by:
getValue in class RegexDocument
Returns:
Object


Copyright © 2014 Tecgraf/PUC-Rio. All rights reserved.