text:
#include "gametext.h"

GameText::GameText() { }

GameText::GameText(Font *f) {
    this->f = f;
}

GameText::~GameText() {
    this->f = nullptr;

    if(this->fsurf != nullptr)
        SDL_FreeSurface(this->fsurf);

    if(this->ftext != nullptr)
        SDL_DestroyTexture(this->ftext);

}

void GameText::setFont(Font *f) {
    this->f = f;
}

bool GameText::setText(const char* tcstr) {

    this->gstr = tcstr;
    this->dirty = true;
    return true;
}

bool GameText::setText(std::string cstr) {

    this->gstr = cstr;
    this->dirty = true;
    return true;
}

bool GameText::prepare(SDL_Renderer *srend) {

    SDL_Color c;
    c.r = this->R(); c.g = this->G(); c.b = this->B(); c.a = this->A();

    /* we already prepared this string once; dont need to do it again */
    if(this->dirty == false) {
        return true;
    }

    if(this->f == NULL) {
        SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_ERROR, "No Font set");
        return false;
    }

    if(this->gstr.empty()) {
        SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_ERROR, "No string set");
        return false;
    }

    /* generate texture to be plotted */
    this->fsurf = TTF_RenderText_Blended(this->f->getFont(), this->gstr.c_str(), c);
    this->ftext = SDL_CreateTextureFromSurface(srend, this->fsurf);

    if(this->fsurf == nullptr || this->ftext == nullptr) {
        SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_ERROR, "Error in text");
        return false;
    }

    this->frect.x = this->X(); this->frect.y = this->Y();

    if(TTF_SizeText(this->f->getFont(), this->gstr.c_str(), &this->frect.w, &this->frect.h)) {
        return false;
    }

    this->dirty = false;
    //this->frect.w = (this->fsize * strlen(this->cstr)); this->frect.h = TTF_FontHeight(this->f);

}

bool GameText::Draw(SDL_Renderer *srend) {
    SDL_Color c;
    c.r = this->R(); c.g = this->G(); c.b = this->B(); c.a = this->A();

    if(this->gstr.empty()) {
        SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_ERROR, "No string set");
        return false;
    }

    /* generate texture to be plotted */
    if(this->fsurf == nullptr || this->ftext == nullptr) {
//        SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_ERROR, "Font not prepared");
//        return false;
        // If font was not prepared, prepare it first
        if(this->prepare(srend) == false) {
            return false;
        }
    }

    SDL_RenderCopy(srend, this->ftext, NULL, &this->frect);

    return true;
}


text:
using System;
using JetBrains.Annotations;

namespace osu.Framework.Graphics.Sprites
{
    ///
    /// Represents a specific usage of an icon.
    ///
    public readonly struct IconUsage : IEquatable<IconUsage>
    {
        ///
        /// The font family name.
        ///
        [CanBeNull]
        public string Family { get; }

        ///
        /// The font weight.
        ///
        [CanBeNull]
        public string Weight { get; }

        ///
        /// The font's full name to be used for lookups. This is an aggregate of all other properties of <see cref="IconUsage"/>.
        /// <remarks>
        /// The format is of the form:

        /// {Family}

        /// {Family}-Italic

        /// {Family}-{Weight}Italic
        /// </remarks>
        ///
        [NotNull]
        public string FontName { get; }

        ///
        /// The icon character.
        ///
        public char Icon { get; }

        ///
        /// Creates an instance of <see cref="IconUsage"/> using the specified font <paramref name="family"/>, font <paramref name="weight"/> and a value indicating whether the used font is italic or not.
        ///
        /// /// <param name="icon">The icon.</param>
        /// <param name="family">The font family name.</param>
        /// <param name="weight">The font weight.</param>
        public IconUsage(char icon, [CanBeNull] string family = null, [CanBeNull] string weight = null)
        {
            Icon = icon;
            Family = family;
            Weight = weight;

            FontName = Family + "-";
            if (!string.IsNullOrEmpty(weight))
                FontName += weight;

            FontName = FontName.TrimEnd('-');
        }

        ///
        /// Creates a new <see cref="IconUsage"/> by applying adjustments to this <see cref="IconUsage"/>.
        ///
        /// <param name="family">The font family. If null, the value is copied from this <see cref="IconUsage"/>.</param>
        /// <param name="weight">The font weight. If null, the value is copied from this <see cref="IconUsage"/>.</param>
        /// <returns>The resulting <see cref="IconUsage"/>.</returns>
        public IconUsage With([CanBeNull] string family = null, [CanBeNull] string weight = null)
            => new IconUsage(Icon, family ?? Family, weight ?? Weight);

        public override string ToString() => $"Icon={Icon} Font={FontName}";

        public bool Equals(IconUsage other) => Icon == other.Icon && Family == other.Family && Weight == other.Weight;

        public override bool Equals(object obj) => obj is IconUsage other && Equals(other);

        public override int GetHashCode() => HashCode.Combine(Family, Icon, Weight);
    }
}

redpajama_set_name: RedPajamaGithub


text:
package com.taobao.weex.ui.component;

import android.annotation.TargetApi;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.PointF;
import android.graphics.Rect;
import android.graphics.Shader;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.LayerDrawable;
import android.os.Build;
import android.os.Message;
import android.support.annotation.CallSuper;
import android.support.annotation.CheckResult;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.view.ViewCompat;
import android.text.TextUtils;
import android.view.Menu;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.taobao.weex.ComponentObserver;
import com.taobao.weex.IWXActivityStateListener;
import com.taobao.weex.WXEnvironment;
import com.taobao.weex.WXSDKInstance;
import com.taobao.weex.WXSDKManager;
import com.taobao.weex.bridge.Invoker;
import com.taobao.weex.common.Constants;
import com.taobao.weex.common.IWXObject;
import com.taobao.weex.common.WXRuntimeException;
import com.taobao.weex.dom.ImmutableDomObject;
import com.taobao.weex.dom.WXDomHandler;
import com.taobao.weex.dom.WXDomObject;
import com.taobao.weex.dom.WXDomTask;
import com.taobao.weex.dom.WXStyle;
import com.taobao.weex.dom.action.Actions;
import com.taobao.weex.dom.flex.Spacing;
import com.taobao.weex.ui.IFComponentHolder;
import com.taobao.weex.ui.animation.WXAnimationModule;
import com.taobao.weex.ui.component.pesudo.OnActivePseudoListner;
import com.taobao.weex.ui.component.pesudo.PesudoStatus;
import com.taobao.weex.ui.component.pesudo.TouchActivePseudoListener;
import com.taobao.weex.ui.view.border.BorderDrawable;
import com.taobao.weex.ui.view.gesture.WXGesture;
import com.taobao.weex.ui.view.gesture.WXGestureObservable;
import com.taobao.weex.ui.view.gesture.WXGestureType;
import com.taobao.weex.utils.WXDataStructureUtil;
import com.taobao.weex.utils.WXLogUtils;
import com.taobao.weex.utils.WXReflectionUtils;
import com.taobao.weex.utils.WXResourceUtils;
import com.taobao.weex.utils.WXUtils;
import com.taobao.weex.utils.WXViewUtils;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * abstract component
 *
 */
public abstract class  WXComponent<T extends View> implements IWXObject, IWXActivityStateListener,OnActivePseudoListner {

  public static final String PROP_FIXED_SIZE = "fixedSize";
  public static final String PROP_FS_MATCH_PARENT = "m";
  public static final String PROP_FS_WRAP_CONTENT = "w";

  private int mFixedProp = 0;
  public static int mComponentNum = 0;
  /** package **/ T mHost;

  private volatile WXVContainer mParent;
  private volatile ImmutableDomObject mDomObj;
  private WXSDKInstance mInstance;
  private Context mContext;

  private int mAbsoluteY = 0;
  private int mAbsoluteX = 0;
  private Set<String> mGestureType;

  private BorderDrawable mBackgroundDrawable;
  private int mPreRealWidth = 0;
  private int mPreRealHeight = 0;
  private int mPreRealLeft = 0;
  private int mPreRealTop = 0;
  private int mStickyOffset = 0;
  private WXGesture mGesture;
  private IFComponentHolder mHolder;
  private boolean isUsing = false;
  private List<OnClickListener> mHostClickListeners;
  private List<OnFocusChangeListener> mFocusChangeListeners;
  private String mCurrentRef;
  private Set<String> mAppendEvents = new HashSet<>();
  private WXAnimationModule.AnimationHolder mAnimationHolder;
  private PesudoStatus mPesudoStatus = new PesudoStatus();
  private boolean mIsDestroyed = false;
  private boolean mIsDisabled = false;
  private int mType = TYPE_COMMON;
  private boolean mNeedLayoutOnAnimation = false;

  public static final int TYPE_COMMON = 0;
  public static final int TYPE_VIRTUAL = 1;

  //Holding the animation bean when component is uninitialized
  public void postAnimation(WXAnimationModule.AnimationHolder holder) {
    this.mAnimationHolder = holder;
  }

  private OnClickListener mClickEventListener = new OnClickListener() {
    @Override
    public void onHostViewClick() {
      Map<String, Object> param= WXDataStructureUtil.newHashMapWithExpectedSize(1);
      Map<String, Object> position = WXDataStructureUtil.newHashMapWithExpectedSize(4);
      int[] location = new int[2];
      mHost.getLocationOnScreen(location);
      position.put("x", WXViewUtils.getWebPxByWidth(location[0],mInstance.getInstanceViewPortWidth()));
      position.put("y", WXViewUtils.getWebPxByWidth(location[1],mInstance.getInstanceViewPortWidth()));
      position.put("width", WXViewUtils.getWebPxByWidth(mDomObj.getLayoutWidth(),mInstance.getInstanceViewPortWidth()));
      position.put("height", WXViewUtils.getWebPxByWidth(mDomObj.getLayoutHeight(),mInstance.getInstanceViewPortWidth()));
      param.put(Constants.Name.POSITION, position);
      fireEvent(Constants.Event.CLICK,param);
    }
  };

  public String getInstanceId() {
    return mInstance.getInstanceId();
  }

  public Rect getComponentSize() {
    Rect size = new Rect();
    if (mHost != null) {
      int[] location = new int[2];
      int[] anchor = new int[2];
      mHost.getLocationOnScreen(location);
      mInstance.getContainerView().getLocationOnScreen(anchor);

      int left = location[0] - anchor[0];
      int top = (location[1] - mStickyOffset) - anchor[1];
      int width = (int) mDomObj.getLayoutWidth();
      int height = (int) mDomObj.getLayoutHeight();
      size.set(left, top, left + width, top + height);
    }
    return size;
  }

  public final void invoke(String method, JSONArray args) {
    final Invoker invoker = mHolder.getMethodInvoker(method);
    if (invoker != null) {
      try {
        getInstance()
            .getNativeInvokeHelper()
            .invoke(this,invoker,args);

      } catch (Exception e) {
        WXLogUtils.e("[WXComponent] updateProperties :" + "class:" + getClass() + "method:" + invoker.toString() + " function " + WXLogUtils.getStackTrace(e));
      }
    }else{
      onInvokeUnknownMethod(method,args);
    }
  }

  /**
   * Will be invoked when request method not found.
   * Subclass should override this method, If you return hard-code method list in {@link IFComponentHolder#getMethods()}
   * @param method
   * @param args
   */
  protected void onInvokeUnknownMethod(String method, JSONArray args){

  }

  public interface OnClickListener{
    void onHostViewClick();
  }

  interface OnFocusChangeListener{
    void onFocusChange(boolean hasFocus);
  }

  @Deprecated
  public WXComponent(WXSDKInstance instance, WXDomObject dom, WXVContainer parent, String instanceId, boolean isLazy) {
    this(instance,dom,parent,isLazy);
  }

  @Deprecated
  public WXComponent(WXSDKInstance instance, WXDomObject dom, WXVContainer parent, boolean isLazy) {
    this(instance,dom,parent);
  }

  public WXComponent(WXSDKInstance instance, WXDomObject dom, WXVContainer parent) {
    this(instance, dom, parent, TYPE_COMMON);
  }

  public WXComponent(WXSDKInstance instance, WXDomObject dom, WXVContainer parent, int type) {
    mInstance = instance;
    mContext = mInstance.getContext();
    mParent = parent;
    mType = type;
    mDomObj = dom.clone();
    mCurrentRef = mDomObj.getRef();
    mGestureType = new HashSet<>();
    ++mComponentNum;
    onCreate();
    ComponentObserver observer;
    if ((observer = getInstance().getComponentObserver()) != null) {
      observer.onCreate(this);
    }
  }

  protected void onCreate(){

  }

  public void bindHolder(IFComponentHolder holder){
    mHolder = holder;
  }

  public WXSDKInstance getInstance(){
    return mInstance;
  }

  public Context getContext(){
    return mContext;
  }

  /**
   * Find component by component reference.
   * @param ref
   * @return
   */
  protected final WXComponent findComponent(String ref){
    if(mInstance != null && ref != null){
      return WXSDKManager.getInstance()
          .getWXRenderManager()
          .getWXComponent(mInstance.getInstanceId(), ref);
    }
    return null;
  }

  public final void fireEvent(String type){
    fireEvent(type,null);
  }

  public final void fireEvent(String type, Map<String, Object> params){
    fireEvent(type,params,null);
  }

  protected final void fireEvent(String type, Map<String, Object> params,Map<String, Object> domChanges){
    if(mInstance != null && mDomObj != null) {
      mInstance.fireEvent(mCurrentRef, type, params,domChanges);
    }
  }

  /**
   * The view is created as needed
   * @return true for lazy
   */
  public boolean isLazy() {
    return mParent != null && mParent.isLazy();
  }

  public void applyLayoutAndEvent(WXComponent component) {
    if(!isLazy()) {
      if (component == null) {
        component = this;
      }
      setLayout(component.getDomObject());
      setPadding(component.getDomObject().getPadding(), component.getDomObject().getBorder());
      addEvents();

    }
  }

  protected final void addFocusChangeListener(OnFocusChangeListener l){
    View view;
    if(l != null && (view = getRealView()) != null) {
      if( mFocusChangeListeners == null){
        mFocusChangeListeners = new ArrayList<>();
        view.setFocusable(true);
        view.setOnFocusChangeListener(new View.OnFocusChangeListener() {
          @Override
          public void onFocusChange(View v, boolean hasFocus) {
            for (OnFocusChangeListener listener : mFocusChangeListeners){
              if(listener != null){
                listener.onFocusChange(hasFocus);
              }
            }
          }
        });
      }
      mFocusChangeListeners.add(l);
    }
  }

  protected final void addClickListener(OnClickListener l){
    View view;
    if(l != null && (view = getRealView()) != null) {
      if(mHostClickListeners == null){
        mHostClickListeners = new ArrayList<>();
        view.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            if(mGesture != null && mGesture.isTouchEventConsumedByAdvancedGesture()){
              //event is already consumed by gesture
              return;
            }
            for (OnClickListener listener : mHostClickListeners){
              if(listener != null) {
                listener.onHostViewClick();
              }
            }
          }
        });
      }
      mHostClickListeners.add(l);

    }
  }

  protected final void removeClickListener(OnClickListener l){
    mHostClickListeners.remove(l);
  }

  public void bindData(WXComponent component){
    if(!isLazy()) {
      if (component == null) {
        component = this;
      }
      mCurrentRef = component.getDomObject().getRef();
      updateStyle(component);
      updateAttrs(component);
      updateExtra(component.getDomObject().getExtra());
    }
  }

  public void updateStyle(WXComponent component){
    ImmutableDomObject domObject = component.getDomObject();
    if(domObject !=null){
      updateProperties(domObject.getStyles());
    }
  }

  public void updateAttrs(WXComponent component){
    ImmutableDomObject domObject = component.getDomObject();
    if(domObject !=null){
      updateProperties(domObject.getAttrs());
    }
  }

  public void refreshData(WXComponent component){

  }

  protected BorderDrawable getOrCreateBorder() {
    if (mBackgroundDrawable == null) {
      Drawable backgroundDrawable = mHost.getBackground();
      WXViewUtils.setBackGround(mHost,null);
      mBackgroundDrawable = new BorderDrawable();
      if (backgroundDrawable == null) {
        WXViewUtils.setBackGround(mHost,mBackgroundDrawable);
      } else {
        //TODO Not strictly clip according to background-clip:border-box
        WXViewUtils.setBackGround(mHost,new LayerDrawable(new Drawable[]{
            mBackgroundDrawable,backgroundDrawable}));
      }
    }
    return mBackgroundDrawable;
  }

  /**
   * layout view
   */
  public final void setLayout(ImmutableDomObject domObject) {
    if ( domObject == null || TextUtils.isEmpty(mCurrentRef)) {
      return;
    }

    boolean nullParent = mParent == null;//parent is nullable
    mDomObj = domObject;

    //offset by sibling
    int siblingOffset = nullParent?0:mParent.getChildrenLayoutTopOffset();

    Spacing parentPadding = (nullParent?new Spacing():mParent.getDomObject().getPadding());
    Spacing parentBorder = (nullParent?new Spacing():mParent.getDomObject().getBorder());
    Spacing margin = mDomObj.getMargin();
    int realWidth = (int) mDomObj.getLayoutWidth();
    int realHeight = (int) mDomObj.getLayoutHeight();
    int realLeft = (int) (mDomObj.getLayoutX() - parentPadding.get(Spacing.LEFT) -
                          parentBorder.get(Spacing.LEFT));
    int realTop = (int) (mDomObj.getLayoutY() - parentPadding.get(Spacing.TOP) -
                         parentBorder.get(Spacing.TOP)) + siblingOffset;
    int realRight = (int) margin.get(Spacing.RIGHT);
    int realBottom = (int) margin.get(Spacing.BOTTOM);

    if (mPreRealWidth == realWidth && mPreRealHeight == realHeight && mPreRealLeft == realLeft && mPreRealTop == realTop) {
      return;
    }

    mAbsoluteY = (int) (nullParent?0:mParent.getAbsoluteY() + mDomObj.getLayoutY());
    mAbsoluteX = (int) (nullParent?0:mParent.getAbsoluteX() + mDomObj.getLayoutX());

    //calculate first screen time
    if (!mInstance.mEnd &&!(mHost instanceof ViewGroup) && mAbsoluteY+realHeight > mInstance.getWeexHeight()+1) {
      mInstance.firstScreenRenderFinished();
    }

    if (mHost == null) {
      return;
    }

    MeasureOutput measureOutput = measure(realWidth, realHeight);
    realWidth = measureOutput.width;
    realHeight = measureOutput.height;

    //fixed style
    if (mDomObj.isFixed()) {
      setFixedHostLayoutParams(mHost,realWidth,realHeight,realLeft,realRight,realTop,realBottom);
    }else {
      setHostLayoutParams(mHost, realWidth, realHeight, realLeft, realRight, realTop, realBottom);
    }

    mPreRealWidth = realWidth;
    mPreRealHeight = realHeight;
    mPreRealLeft = realLeft;
    mPreRealTop = realTop;

    onFinishLayout();
  }

  public int getLayoutTopOffsetForSibling(){
    return 0;
  }

  protected void setHostLayoutParams(T host, int width, int height, int left, int right, int top, int bottom){
    ViewGroup.LayoutParams lp;
    if(mParent == null){
      FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(width,height);
      params.setMargins(left, top, right, bottom);
      lp = params;
    }else{
      lp = mParent.getChildLayoutParams(this,host,width, height, left,right,top,bottom);
    }
    if(lp != null) {
      mHost.setLayoutParams(lp);
    }
  }

  private void setFixedHostLayoutParams(T host, int width, int height, int left, int right, int top, int bottom){
    FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);

    params.width = width;
    params.height = height;
    params.setMargins(left, top, right, bottom);
    host.setLayoutParams(params);
    mInstance.moveFixedView(host);

    if (WXEnvironment.isApkDebugable()) {
      WXLogUtils.d("Weex_Fixed_Style", "WXComponent:setLayout :" + left + " " + top + " " + width + " " + height);
      WXLogUtils.d("Weex_Fixed_Style", "WXComponent:setLayout Left:" + mDomObj.getStyles().getLeft() + " " + (int) mDomObj.getStyles().getTop());
    }
  }

  /**
   * After component's layout result is apply to view. May be invoke multiple times since
   * DOM can be changed in js runtime.
   */
  protected void onFinishLayout() {
    Object param = mDomObj.getStyles() != null ? mDomObj.getStyles().get(Constants.Name.BACKGROUND_IMAGE) : null;
    if (param != null) {
      setBackgroundImage(param.toString());
    }
  }

  public void setPadding(Spacing padding, Spacing border) {
    int left = (int) (padding.get(Spacing.LEFT) + border.get(Spacing.LEFT));
    int top = (int) (padding.get(Spacing.TOP) + border.get(Spacing.TOP));
    int right = (int) (padding.get(Spacing.RIGHT) + border.get(Spacing.RIGHT));
    int bottom = (int) (padding.get(Spacing.BOTTOM) + border.get(Spacing.BOTTOM));

    if (mHost == null) {
      return;
    }
    mHost.setPadding(left, top, right, bottom);
  }

  private void addEvents() {
    int count = mDomObj.getEvents().size();
    for (int i = 0; i < count; ++i) {
      addEvent(mDomObj.getEvents().get(i));
    }
    setActiveTouchListener();
  }

  public void updateExtra(Object extra) {

  }

  public ImmutableDomObject getDomObject() {
    return mDomObj;
  }

  /**
   * measure
   */
  protected MeasureOutput measure(int width, int height) {
    MeasureOutput measureOutput = new MeasureOutput();

    if(mFixedProp != 0){
      measureOutput.width = mFixedProp;
      measureOutput.height = mFixedProp;
    }else {
      measureOutput.width = width;
      measureOutput.height = height;
    }
    return measureOutput;
  }

  @Deprecated
  public void updateProperties(Map<String, Object> props) {
    if (props == null || (mHost == null && !isVirtualComponent())) {
      return;
    }

    for (Map.Entry<String, Object> entry : props.entrySet()) {
      String key = entry.getKey();
      Object param = entry.getValue();
      String value = WXUtils.getString(param, null);
      if (TextUtils.isEmpty(value)) {
        param = convertEmptyProperty(key, value);
      }
      if (!setProperty(key, param)) {
        if (mHolder == null) {
          return;
        }
        Invoker invoker = mHolder.getPropertyInvoker(key);
        if (invoker != null) {
          try {
            Type[] paramClazzs = invoker.getParameterTypes();
            if (paramClazzs.length != 1) {
              WXLogUtils.e("[WXComponent] setX method only one parameter:" + invoker);
              return;
            }
            param = WXReflectionUtils.parseArgument(paramClazzs[0], param);
            invoker.invoke(this, param);
          } catch (Exception e) {
            WXLogUtils.e("[WXComponent] updateProperties :" + "class:" + getClass() + "method:" + invoker.toString() + " function " + WXLogUtils.getStackTrace(e));
          }
        }
      }
    }
    readyToRender();
  }

  /**
   * Apply styles and attributes.
   * @param key name of argument
   * @param param value of argument
   * @return true means that the property is consumed
     */
  protected boolean setProperty(String key, Object param) {
    switch (key) {
      case Constants.Name.PREVENT_MOVE_EVENT:
        if(mGesture != null){
          mGesture.setPreventMoveEvent(WXUtils.getBoolean(param,false));
        }
        return true;
      case Constants.Name.DISABLED:
        Boolean disabled = WXUtils.getBoolean(param,null);
        if (disabled != null) {
          setDisabled(disabled);
          setPseudoClassStatus(Constants.PSEUDO.DISABLED, disabled);
        }
        return true;
      case Constants.Name.POSITION:
        String position = WXUtils.getString(param,null);
        if (position != null)
          setSticky(position);
        return true;
      case Constants.Name.BACKGROUND_COLOR:
        String bgColor = WXUtils.getString(param,null);
        if (bgColor != null)
          setBackgroundColor(bgColor);
        return true;
      case Constants.Name.BACKGROUND_IMAGE:
        String bgImage = WXUtils.getString(param, null);
        if (bgImage != null && mHost != null) {
          setBackgroundImage(bgImage);
        }
        return true;
      case Constants.Name.OPACITY:
        Float opacity = WXUtils.getFloat(param,null);
        if (opacity != null)
          setOpacity(opacity);
        return true;
      case Constants.Name.BORDER_RADIUS:
      case Constants.Name.BORDER_TOP_LEFT_RADIUS:
      case Constants.Name.BORDER_TOP_RIGHT_RADIUS:
      case Constants.Name.BORDER_BOTTOM_RIGHT_RADIUS:
      case Constants.Name.BORDER_BOTTOM_LEFT_RADIUS:
        Float radius = WXUtils.getFloat(param,null);
        if (radius != null)
          setBorderRadius(key,radius);
        return true;
      case Constants.Name.BORDER_WIDTH:
      case Constants.Name.BORDER_TOP_WIDTH:
      case Constants.Name.BORDER_RIGHT_WIDTH:
      case Constants.Name.BORDER_BOTTOM_WIDTH:
      case Constants.Name.BORDER_LEFT_WIDTH:
        Float width = WXUtils.getFloat(param,null);
        if (width != null)
          setBorderWidth(key,width);
        return true;
      case Constants.Name.BORDER_STYLE:
      case Constants.Name.BORDER_RIGHT_STYLE:
      case Constants.Name.BORDER_BOTTOM_STYLE:
      case Constants.Name.BORDER_LEFT_STYLE:
      case Constants.Name.BORDER_TOP_STYLE:
        String border_style = WXUtils.getString(param,null);
        if (border_style != null)
          setBorderStyle(key, border_style);
        return true;
      case Constants.Name.BORDER_COLOR:
      case Constants.Name.BORDER_TOP_COLOR:
      case Constants.Name.BORDER_RIGHT_COLOR:
      case Constants.Name.BORDER_BOTTOM_COLOR:
      case Constants.Name.BORDER_LEFT_COLOR:
        String border_color = WXUtils.getString(param,null);
        if (border_color != null)
          setBorderColor(key, border_color);
        return true;
      case Constants.Name.VISIBILITY:
        String visibility = WXUtils.getString(param,null);
        if (visibility != null)
          setVisibility(visibility);
        return true;
      case Constants.Name.ELEVATION:
        if(param!=null) {
          updateElevation();
        }
        return true;
      case PROP_FIXED_SIZE:
        String fixedSize = WXUtils.getString(param, PROP_FS_MATCH_PARENT);
        setFixedSize(fixedSize);
        return true;
      case Constants.Name.ARIA_LABEL:
        String label = WXUtils.getString(param,"");
        setAriaLabel(label);
        return true;
      case Constants.Name.ARIA_HIDDEN:
        boolean isHidden = WXUtils.getBoolean(param,false);
        setAriaHidden(isHidden);
        return true;
      case Constants.Name.WIDTH:
      case Constants.Name.MIN_WIDTH:
      case Constants.Name.MAX_WIDTH:
      case Constants.Name.HEIGHT:
      case Constants.Name.MIN_HEIGHT:
      case Constants.Name.MAX_HEIGHT:
      case Constants.Name.ALIGN_ITEMS:
      case Constants.Name.ALIGN_SELF:
      case Constants.Name.FLEX:
      case Constants.Name.FLEX_DIRECTION:
      case Constants.Name.JUSTIFY_CONTENT:
      case Constants.Name.FLEX_WRAP:
      case Constants.Name.MARGIN:
      case Constants.Name.MARGIN_TOP:
      case Constants.Name.MARGIN_LEFT:
      case Constants.Name.MARGIN_RIGHT:
      case Constants.Name.MARGIN_BOTTOM:
      case Constants.Name.PADDING:
      case Constants.Name.PADDING_TOP:
      case Constants.Name.PADDING_LEFT:
      case Constants.Name.PADDING_RIGHT:
      case Constants.Name.PADDING_BOTTOM:
      case Constants.Name.LEFT:
      case Constants.Name.TOP:
      case Constants.Name.RIGHT:
      case Constants.Name.BOTTOM:
        return true;
      default:
        return false;
    }
  }

  private void setPerspective(Object param) {
    T host = getHostView();
    if (host != null) {
      float value = WXUtils.getFloatByViewport(param, getInstance().getInstanceViewPortWidth());
      float scale = host.getResources().getDisplayMetrics().density;
      if (!Float.isNaN(value) && value > 0) {
        host.setCameraDistance(value * scale);
      } else {
        host.setCameraDistance(Float.MAX_VALUE);
      }
    }
  }

  @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
  protected void setAriaHidden(boolean isHidden) {
    View host = getHostView();
    if(host != null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN){
      host.setImportantForAccessibility(isHidden?View.IMPORTANT_FOR_ACCESSIBILITY_NO:View.IMPORTANT_FOR_ACCESSIBILITY_YES);
    }
  }

  protected void setAriaLabel(String label) {
    View host = getHostView();
    if(host != null){
      host.setContentDescription(label);
    }
  }

  /**
   * Avoid large size view fail in GPU-Animation.
   * @param fixedSize
   */
  private void setFixedSize(String fixedSize) {
    if(PROP_FS_MATCH_PARENT.equals(fixedSize)){
      mFixedProp = ViewGroup.LayoutParams.MATCH_PARENT;
    }else if(PROP_FS_WRAP_CONTENT.equals(fixedSize)){
      mFixedProp = ViewGroup.LayoutParams.WRAP_CONTENT;
    }else{
      mFixedProp = 0;
      return;
    }
    if(mHost != null){
      ViewGroup.LayoutParams layoutParams = mHost.getLayoutParams();
      if(layoutParams != null){
        layoutParams.height = mFixedProp;
        layoutParams.width = mFixedProp;
        mHost.setLayoutParams(layoutParams);
      }
    }
  }

  /**
   * Add new event to component,this will post a task to DOM thread to add event.
   * @param type
   */
  protected void appendEventToDOM(String type){
    WXSDKManager.getInstance().getWXDomManager().postAction(getInstanceId(), Actions.getAddEvent(getRef(),type),false);
  }

  /**
   * Do not use this method to add event, this only apply event already add to DomObject.
   * @param type
   */
  public void addEvent(String type) {
    if (TextUtils.isEmpty(type) || mAppendEvents.contains(type)) {
      return;
    }
    mAppendEvents.add(type);

    View view = getRealView();
    if (type.equals(Constants.Event.CLICK) && view != null) {
      addClickListener(mClickEventListener);
    } else if ((type.equals( Constants.Event.FOCUS) || type.equals( Constants.Event.BLUR)) ) {
      addFocusChangeListener(new OnFocusChangeListener() {
        public void onFocusChange(boolean hasFocus) {
          Map<String, Object> params = new HashMap<>();
          params.put("timeStamp", System.currentTimeMillis());
          fireEvent(hasFocus ? Constants.Event.FOCUS : Constants.Event.BLUR, params);
        }
      });
    } else if (view != null &&
               needGestureDetector(type)) {
      if (view instanceof WXGestureObservable) {
        if (mGesture == null) {
          mGesture = new WXGesture(this, mContext);
          boolean isPreventMove = WXUtils.getBoolean(getDomObject().getAttrs().get(Constants.Name.PREVENT_MOVE_EVENT),false);
          mGesture.setPreventMoveEvent(isPreventMove);
        }
        mGestureType.add(type);
        ((WXGestureObservable) view).registerGestureListener(mGesture);
      } else {
        WXLogUtils.e(view.getClass().getSimpleName() + " don't implement " +
                     "WXGestureObservable, so no gesture is supported.");
      }
    } else {
      Scrollable scroller = getParentScroller();
      if (type.equals(Constants.Event.APPEAR) && scroller != null) {
        scroller.bindAppearEvent(this);
      }
      if (type.equals(Constants.Event.DISAPPEAR) && scroller != null) {
        scroller.bindDisappearEvent(this);
      }
    }
  }

  public View getRealView() {
    return mHost;
  }

  /**
   * Judge whether need to set an onTouchListener.<br>
   * As there is only one onTouchListener in each view, so all the gesture that use onTouchListener should put there.
   *
   * @param type eventType {@link com.taobao.weex.common.Constants.Event}
   * @return true for set an onTouchListener, otherwise false
   */
  private boolean needGestureDetector(String type) {
    if (mHost != null) {
      for (WXGestureType gesture : WXGestureType.LowLevelGesture.values()) {
        if (type.equals(gesture.toString())) {
          return true;
        }
      }
      for (WXGestureType gesture : WXGestureType.HighLevelGesture.values()) {
        if (type.equals(gesture.toString())) {
          return true;
        }
      }
    }
    return false;
  }

  /**
   * get Scroller components
   */
  public Scrollable getParentScroller() {
    WXComponent component = this;
    WXVContainer container;
    Scrollable scroller;
    for (; ; ) {
      container = component.getParent();
      if (container == null) {
        return null;
      }
      if (container instanceof Scrollable) {
        scroller = (Scrollable) container;
        return scroller;
      }
      if (container.getRef().equals(WXDomObject.ROOT)) {
        return null;
      }
      component = container;
    }
  }

  /**
   * get Scroller components
   */
  @Nullable
  public Scrollable getFirstScroller() {
   if(this instanceof Scrollable){
     return (Scrollable)this;
   }
   return null;
  }

  public WXVContainer getParent() {
    return mParent;
  }

  public String getRef() {
    if (mDomObj == null) {
      return null;
    }
    return mCurrentRef;
  }

  /**
   * create view
   *
   */
  public final void createView() {
    if(!isLazy()) {
      createViewImpl();
    }
  }

  protected void createViewImpl() {
    if (mContext != null) {
      mHost = initComponentHostView(mContext);
      if (mHost == null && !isVirtualComponent()) {
        //compatible
        initView();
      }
      if(mHost != null){
        mHost.setId(WXViewUtils.generateViewId());
        ComponentObserver observer;
        if ((observer = getInstance().getComponentObserver()) != null) {
          observer.onViewCreated(this, mHost);
        }
      }
      onHostViewInitialized(mHost);
    }else{
      WXLogUtils.e("createViewImpl","Context is null");
    }
  }

  /**
   * Use {@link #initComponentHostView(Context context)} instead.
   */
  @Deprecated
  protected void initView() {
    if (mContext != null)
      mHost = initComponentHostView(mContext);
  }

  /**
   * Create corresponding view for this component.
   * @param context
   * @return
   */
  protected T initComponentHostView(@NonNull Context context){
    /**
     * compatible old initView
     * TODO: change to abstract method in next V1.0 .
     */
    return null;
  }

  /**
   * Called after host view init. <br>
   * Any overriding methods should invoke this method at the right time, to ensure the cached animation can be triggered correctly.
   * (the animation will be cached when {@link #isLazy()} is true)
   * @param host the host view
   */
  @CallSuper
  protected void onHostViewInitialized(T host){
    if(host!=null){
      host.setCameraDistance(Float.MAX_VALUE);
    }
    if (mAnimationHolder != null) {
      //Performs cached animation
      mAnimationHolder.execute(mInstance, this);
    }
    setActiveTouchListener();
  }

  public T getHostView() {
    return mHost;
  }

  /**
   * use {@link #getHostView()} instead
   * @return
   */
  @Deprecated
  public View getView(){
    return mHost;
  }

  public int getAbsoluteY() {
    return mAbsoluteY;
  }

  public int getAbsoluteX() {
    return mAbsoluteX;
  }

  public void updateDom(WXDomObject dom) {
    if (dom == null) {
      return;
    }
    mDomObj = dom.clone();
  }

  public final void removeEvent(String type) {
    if (TextUtils.isEmpty(type)) {
      return;
    }
    mAppendEvents.remove(type);//only clean append events, not dom's events.
    mGestureType.remove(type);
    removeEventFromView(type);
  }

  protected void removeEventFromView(String type) {
    if (type.equals(Constants.Event.CLICK) && getRealView() != null && mHostClickListeners != null) {
      mHostClickListeners.remove(mClickEventListener);
      //click event only remove from listener array
    }
    Scrollable scroller = getParentScroller();
    if (type.equals(Constants.Event.APPEAR) && scroller != null) {
      scroller.unbindAppearEvent(this);
    }
    if (type.equals(Constants.Event.DISAPPEAR) && scroller != null) {
      scroller.unbindDisappearEvent(this);
    }
  }

  public final void removeAllEvent() {
    if (mDomObj == null || mDomObj.getEvents().size() < 1) {
      return;
    }
    for (String event : mDomObj.getEvents()) {
      if(event == null){
        continue;
      }
      removeEventFromView(event);
    }
    mAppendEvents.clear();//only clean append events, not dom's events.
    mGestureType.clear();
    mGesture = null;
    if (getRealView() != null &&
        getRealView() instanceof WXGestureObservable) {
      ((WXGestureObservable) getRealView()).registerGestureListener(null);
    }
    if(mHost != null) {
      mHost.setOnFocusChangeListener(null);
      if (mHostClickListeners != null && mHostClickListeners.size() > 0) {
        mHostClickListeners.clear();
        mHost.setOnClickListener(null);
      }
    }
  }

  public final void removeStickyStyle() {
    if (mDomObj == null ) {
      return;
    }

    if (isSticky()) {
      Scrollable scroller = getParentScroller();
      if (scroller != null) {
        scroller.unbindStickStyle(this);
      }
    }
  }

  public boolean isSticky() {
    return mDomObj.getStyles().isSticky();
  }

  public boolean isFixed() {
    return mDomObj.getStyles().isFixed();
  }

  public void setDisabled(boolean disabled) {
    mIsDisabled = disabled;
    if (mHost == null) {
      return;
    }
    mHost.setEnabled(!disabled);
  }

  public boolean isDisabled(){
    return mIsDisabled;
  }

  public void setSticky(String sticky) {
    if (!TextUtils.isEmpty(sticky) && sticky.equals(Constants.Value.STICKY)) {
      Scrollable waScroller = getParentScroller();
      if (waScroller != null) {
        waScroller.bindStickStyle(this);
      }
    }
  }

  public void setBackgroundColor(String color) {
    if (!TextUtils.isEmpty(color)&& mHost!=null) {
      int colorInt = WXResourceUtils.getColor(color);
      if (!(colorInt == Color.TRANSPARENT && mBackgroundDrawable == null)){
          getOrCreateBorder().setColor(colorInt);
      }
    }
  }

  public void setBackgroundImage(@NonNull String bgImage) {
    if ("".equals(bgImage.trim())) {
      getOrCreateBorder().setImage(null);
    } else {
      Shader shader = WXResourceUtils.getShader(bgImage, mDomObj.getLayoutWidth(), mDomObj.getLayoutHeight());
      getOrCreateBorder().setImage(shader);
    }
  }

  public void setOpacity(float opacity) {
    if (opacity >= 0 && opacity <= 1 && mHost.getAlpha() != opacity) {
      if (isLayerTypeEnabled()) {
        mHost.setLayerType(View.LAYER_TYPE_HARDWARE, null);
      }
      mHost.setAlpha(opacity);
    }
  }

  public void setBorderRadius(String key, float borderRadius) {
    if (borderRadius >= 0) {
      switch (key) {
        case Constants.Name.BORDER_RADIUS:
          getOrCreateBorder().setBorderRadius(BorderDrawable.BORDER_RADIUS_ALL, WXViewUtils.getRealSubPxByWidth(borderRadius,mInstance.getInstanceViewPortWidth()));
          break;
        case Constants.Name.BORDER_TOP_LEFT_RADIUS:
          getOrCreateBorder().setBorderRadius(BorderDrawable.BORDER_TOP_LEFT_RADIUS, WXViewUtils.getRealSubPxByWidth(borderRadius,mInstance.getInstanceViewPortWidth()));
          break;
        case Constants.Name.BORDER_TOP_RIGHT_RADIUS:
          getOrCreateBorder().setBorderRadius(BorderDrawable.BORDER_TOP_RIGHT_RADIUS, WXViewUtils.getRealSubPxByWidth(borderRadius,mInstance.getInstanceViewPortWidth()));
          break;
        case Constants.Name.BORDER_BOTTOM_RIGHT_RADIUS:
          getOrCreateBorder().setBorderRadius(BorderDrawable.BORDER_BOTTOM_RIGHT_RADIUS, WXViewUtils.getRealSubPxByWidth(borderRadius,mInstance.getInstanceViewPortWidth()));
          break;
        case Constants.Name.BORDER_BOTTOM_LEFT_RADIUS:
          getOrCreateBorder().setBorderRadius(BorderDrawable.BORDER_BOTTOM_LEFT_RADIUS, WXViewUtils.getRealSubPxByWidth(borderRadius,mInstance.getInstanceViewPortWidth()));
          break;
      }
    }
  }

  public void setBorderWidth(String key, float borderWidth) {
    if (borderWidth >= 0) {
      switch (key) {
        case Constants.Name.BORDER_WIDTH:
          getOrCreateBorder().setBorderWidth(Spacing.ALL, WXViewUtils.getRealSubPxByWidth(borderWidth,getInstance().getInstanceViewPortWidth()));
          break;
        case Constants.Name.BORDER_TOP_WIDTH:
          getOrCreateBorder().setBorderWidth(Spacing.TOP, WXViewUtils.getRealSubPxByWidth(borderWidth,getInstance().getInstanceViewPortWidth()));
          break;
        case Constants.Name.BORDER_RIGHT_WIDTH:
          getOrCreateBorder().setBorderWidth(Spacing.RIGHT, WXViewUtils.getRealSubPxByWidth(borderWidth,getInstance().getInstanceViewPortWidth()));
          break;
        case Constants.Name.BORDER_BOTTOM_WIDTH:
          getOrCreateBorder().setBorderWidth(Spacing.BOTTOM, WXViewUtils.getRealSubPxByWidth(borderWidth,getInstance().getInstanceViewPortWidth()));
          break;
        case Constants.Name.BORDER_LEFT_WIDTH:
          getOrCreateBorder().setBorderWidth(Spacing.LEFT, WXViewUtils.getRealSubPxByWidth(borderWidth,getInstance().getInstanceViewPortWidth()));
          break;
      }
    }
  }

  public void setBorderStyle(String key, String borderStyle) {
    if(!TextUtils.isEmpty(borderStyle)){
      switch (key){
        case Constants.Name.BORDER_STYLE:
          getOrCreateBorder().setBorderStyle(Spacing.ALL,borderStyle);
          break;
        case Constants.Name.BORDER_RIGHT_STYLE:
          getOrCreateBorder().setBorderStyle(Spacing.RIGHT,borderStyle);
          break;
        case Constants.Name.BORDER_BOTTOM_STYLE:
          getOrCreateBorder().setBorderStyle(Spacing.BOTTOM,borderStyle);
          break;
        case Constants.Name.BORDER_LEFT_STYLE:
          getOrCreateBorder().setBorderStyle(Spacing.LEFT,borderStyle);
          break;
        case Constants.Name.BORDER_TOP_STYLE:
          getOrCreateBorder().setBorderStyle(Spacing.TOP,borderStyle);
          break;
      }
    }
  }

  public void setBorderColor(String key, String borderColor) {
    if (!TextUtils.isEmpty(borderColor)) {
      int colorInt = WXResourceUtils.getColor(borderColor);
      if (colorInt != Integer.MIN_VALUE) {
        switch (key) {
          case Constants.Name.BORDER_COLOR:
            getOrCreateBorder().setBorderColor(Spacing.ALL, colorInt);
            break;
          case Constants.Name.BORDER_TOP_COLOR:
            getOrCreateBorder().setBorderColor(Spacing.TOP, colorInt);
            break;
          case Constants.Name.BORDER_RIGHT_COLOR:
            getOrCreateBorder().setBorderColor(Spacing.RIGHT, colorInt);
            break;
          case Constants.Name.BORDER_BOTTOM_COLOR:
            getOrCreateBorder().setBorderColor(Spacing.BOTTOM, colorInt);
            break;
          case Constants.Name.BORDER_LEFT_COLOR:
            getOrCreateBorder().setBorderColor(Spacing.LEFT, colorInt);
            break;
        }
      }
    }
  }

  public
  @Nullable
  String getVisibility() {
    try {
      return (String) getDomObject().getStyles().get(Constants.Name.VISIBILITY);
    } catch (Exception e) {
      return Constants.Value.VISIBLE;
    }
  }

  public void setVisibility(String visibility) {
    View view;
    if ((view = getRealView()) != null) {
      if (TextUtils.equals(visibility, Constants.Value.VISIBLE)) {
        view.setVisibility(View.VISIBLE);
      } else if (TextUtils.equals(visibility, Constants.Value.HIDDEN)) {
        view.setVisibility(View.GONE);
      }
    }
  }

  /**
   * This is an experimental feature for elevation of material design.
   */
  private void updateElevation() {
    float elevation = getDomObject().getAttrs().getElevation(getInstance().getInstanceViewPortWidth());
    if (!Float.isNaN(elevation)) {
      ViewCompat.setElevation(getHostView(), elevation);
    }
  }

  @Deprecated
  public void registerActivityStateListener() {

  }

  /********************************
   *  begin hook Activity life cycle callback
   ********************************************************/
  public void onActivityCreate() {

  }

  public void onActivityStart() {

  }

  public void onActivityPause() {

  }

  public void onActivityResume() {

  }

  public void onActivityStop() {

  }

  public void onActivityDestroy() {

  }

  public boolean onActivityBack() {
    return false;
  }

  public void onActivityResult(int requestCode, int resultCode, Intent data){

  }

  public boolean onCreateOptionsMenu(Menu menu){return false;}

  public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {

  }

  /********************************
   *  end hook Activity life cycle callback
   ********************************************************/
  public void recycled() {
    if(mDomObj.isFixed())
      return;

  }

  public void destroy() {
    ComponentObserver observer;
    if ((observer = getInstance().getComponentObserver()) != null) {
      observer.onPreDestory(this);
    }

    if (WXEnvironment.isApkDebugable() && !WXUtils.isUiThread()) {
      throw new WXRuntimeException("[WXComponent] destroy can only be called in main thread");
    }
    if(mHost!= null && mHost.getLayerType()==View.LAYER_TYPE_HARDWARE && isLayerTypeEnabled()) {
      mHost.setLayerType(View.LAYER_TYPE_NONE, null);
    }
    removeAllEvent();
    removeStickyStyle();

    View view;
    if(mDomObj.isFixed() && (view = getHostView()) != null){
      getInstance().removeFixedView(view);
    }

    mDomObj = ImmutableDomObject.DESTROYED;
    mIsDestroyed = true;
  }

  public boolean isDestoryed() {
    return mIsDestroyed;
  }

  /**
   * Detach view from its component. Components,
   * which have difference between getHostView and getRealView or have temp calculation results,
   * must<strong> override</strong>  this method with their own implementation.
   *
   * @return the original View
   */
  public View detachViewAndClearPreInfo() {
    View original = mHost;
    mPreRealLeft = 0;
    mPreRealWidth = 0;
    mPreRealHeight = 0;
    mPreRealTop = 0;
//    mHost = null;
    return original;
  }

  /**
   * This method computes user visible left-top point in view's coordinate.
   * The default implementation uses the scrollX and scrollY of the view as the result,
   * and put the value in the parameter pointer.
   * Components with different computation algorithm
   * <strong> should override </strong> this method.
   *
   * @param pointF the user visible left-top point in view's coordinate.
   */
  public void computeVisiblePointInViewCoordinate(PointF pointF) {
    View view = getRealView();
    pointF.set(view.getScrollX(), view.getScrollY());
  }

  public boolean containsGesture(WXGestureType WXGestureType) {
    return mGestureType != null && mGestureType.contains(WXGestureType.toString());
  }

  protected boolean containsEvent(String event){
    return mDomObj.getEvents().contains(event) || mAppendEvents.contains(event);
  }

  public void notifyAppearStateChange(String wxEventType,String direction){
    if(containsEvent(Constants.Event.APPEAR) || containsEvent(Constants.Event.DISAPPEAR)) {
      Map<String, Object> params = new HashMap<>();
      params.put("direction", direction);
      fireEvent(wxEventType, params);
    }
  }

  public boolean isUsing() {
    return isUsing;
  }

  public void setUsing(boolean using) {
    isUsing = using;
  }

  public void readyToRender() {
    if (mParent != null && getInstance().isTrackComponent()) {
      mParent.readyToRender();
    }
  }

  public static class MeasureOutput {

    public int width;
    public int height;
  }

  /**
   * Determine whether the current component needs to be placed in the real View tree
   * @return false component add subview
   */
  public boolean isVirtualComponent(){
    return mType == TYPE_VIRTUAL;
  }
  public void removeVirtualComponent() {
  }

  public void setType(int type) {
    mType = type;
  }

  public boolean hasScrollParent(WXComponent component) {
    if (component.getParent() == null) {
      return true;
    } else if (component.getParent() instanceof WXScroller) {
      return false;
    } else {
      return hasScrollParent(component.getParent());
    }
  }

  /**
   * Called when property has empty value
   * @param propName
     */
  @CheckResult
  protected Object convertEmptyProperty(String propName, Object originalValue) {
    switch (propName) {
      case Constants.Name.BACKGROUND_COLOR:
        return "transparent";
      case Constants.Name.BORDER_RADIUS:
      case Constants.Name.BORDER_BOTTOM_LEFT_RADIUS:
      case Constants.Name.BORDER_BOTTOM_RIGHT_RADIUS:
      case Constants.Name.BORDER_TOP_LEFT_RADIUS:
      case Constants.Name.BORDER_TOP_RIGHT_RADIUS:
        return 0;
      case Constants.Name.BORDER_WIDTH:
      case Constants.Name.BORDER_TOP_WIDTH:
      case Constants.Name.BORDER_LEFT_WIDTH:
      case Constants.Name.BORDER_RIGHT_WIDTH:
      case Constants.Name.BORDER_BOTTOM_WIDTH:
        return 0;
      case Constants.Name.BORDER_COLOR:
      case Constants.Name.BORDER_TOP_COLOR:
      case Constants.Name.BORDER_LEFT_COLOR:
      case Constants.Name.BORDER_RIGHT_COLOR:
      case Constants.Name.BORDER_BOTTOM_COLOR:
        return "black";
    }
    return originalValue;
  }

  private void setActiveTouchListener(){
    boolean hasActivePesudo = mDomObj.getStyles().getPesudoStyles().containsKey(Constants.PSEUDO.ACTIVE);
    View view;
    if(hasActivePesudo && (view = getRealView()) != null) {
      boolean hasTouchConsumer = isConsumeTouch();
      view.setOnTouchListener(new TouchActivePseudoListener(this,!hasTouchConsumer));
    }
  }

  protected boolean isConsumeTouch(){
    return (mHostClickListeners != null && mHostClickListeners.size() > 0) || mGesture != null;
  }

  @Override
  public void updateActivePseudo(boolean isSet) {
    setPseudoClassStatus(Constants.PSEUDO.ACTIVE,isSet);
  }

  /**
   *
   * @param clzName like ':active' or ':active:enabled'
   * @param status
   */
  protected void setPseudoClassStatus(String clzName,boolean status){
    WXStyle styles = getDomObject().getStyles();
    Map<String, Map<String,Object>> pesudoStyles = styles.getPesudoStyles();

    if(pesudoStyles == null || pesudoStyles.size() == 0){
      return;
    }
    Map<String,Object> resultStyles = mPesudoStatus.updateStatusAndGetUpdateStyles(
        clzName,
        status,
        pesudoStyles,
        styles.getPesudoResetStyles());
    updateStyleByPesudo(resultStyles);
  }

  private void updateStyleByPesudo(Map<String,Object> styles){
    Message message = Message.obtain();
    WXDomTask task = new WXDomTask();
    task.instanceId = getInstanceId();
    task.args = new ArrayList<>();

    JSONObject styleJson = new JSONObject(styles);
    task.args.add(getRef());
    task.args.add(styleJson);
    task.args.add(true);//flag pesudo
    message.obj = task;
    message.what = WXDomHandler.MsgType.WX_DOM_UPDATE_STYLE;
    WXSDKManager.getInstance().getWXDomManager().sendMessage(message);
  }

  public int getStickyOffset() {
    return mStickyOffset;
  }

  public boolean canRecycled(){
    return (!isFixed() || !isSticky()) && mDomObj.getAttrs().canRecycled();
  }

  /**
   * Sets the offset for the sticky
   * @param stickyOffset child[y]-parent[y]
   */
  public void setStickyOffset(int stickyOffset) {
    mStickyOffset = stickyOffset;
  }

  /**
   * For now, this method respect the result of {@link WXSDKInstance#isLayerTypeEnabled()}
   * @return Refer {@link WXSDKInstance#isLayerTypeEnabled()}
   */
  public boolean isLayerTypeEnabled() {
    return getInstance().isLayerTypeEnabled();
  }

  /**
   * Sets whether or not to relayout page during animation, default is false
   */
  public void setNeedLayoutOnAnimation(boolean need) {
    this.mNeedLayoutOnAnimation = need;
  }

  /**
   * Trigger a updateStyle invoke to relayout current page
   */
  public void notifyNativeSizeChanged(int w, int h) {
    if (!mNeedLayoutOnAnimation) {
      return;
    }

    Message message = Message.obtain();
    WXDomTask task = new WXDomTask();
    task.instanceId = getInstanceId();
    if (task.args == null) {
      task.args = new ArrayList<>();
    }

    JSONObject style = new JSONObject(2);
    float webW = WXViewUtils.getWebPxByWidth(w);
    float webH = WXViewUtils.getWebPxByWidth(h);

    style.put("width", webW);
    style.put("height", webH);

    task.args.add(getRef());
    task.args.add(style);
    message.obj = task;
    message.what = WXDomHandler.MsgType.WX_DOM_UPDATE_STYLE;
    WXSDKManager.getInstance().getWXDomManager().sendMessage(message);
  }
}


text:
package com.amazonaws.services.directory.model;

import java.io.Serializable;
import javax.annotation.Generated;

import com.amazonaws.AmazonWebServiceRequest;

/**
 *
 * @see AWS API
 *      Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class RemoveTagsFromResourceRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {

    /**
     *

     * Identifier (ID) of the directory from which to remove the tag.
     *

     */
    private String resourceId;
    /**
     *

     * The tag key (name) of the tag to be removed.
     *

     */
    private com.amazonaws.internal.SdkInternalList<String> tagKeys;

    /**
     *

     * Identifier (ID) of the directory from which to remove the tag.
     *

     *
     * @param resourceId
     *        Identifier (ID) of the directory from which to remove the tag.
     */

    public void setResourceId(String resourceId) {
        this.resourceId = resourceId;
    }

    /**
     *

     * Identifier (ID) of the directory from which to remove the tag.
     *

     *
     * @return Identifier (ID) of the directory from which to remove the tag.
     */

    public String getResourceId() {
        return this.resourceId;
    }

    /**
     *

     * Identifier (ID) of the directory from which to remove the tag.
     *

     *
     * @param resourceId
     *        Identifier (ID) of the directory from which to remove the tag.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public RemoveTagsFromResourceRequest withResourceId(String resourceId) {
        setResourceId(resourceId);
        return this;
    }

    /**
     *

     * The tag key (name) of the tag to be removed.
     *

     *
     * @return The tag key (name) of the tag to be removed.
     */

    public java.util.List<String> getTagKeys() {
        if (tagKeys == null) {
            tagKeys = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return tagKeys;
    }

    /**
     *

     * The tag key (name) of the tag to be removed.
     *

     *
     * @param tagKeys
     *        The tag key (name) of the tag to be removed.
     */

    public void setTagKeys(java.util.Collection<String> tagKeys) {
        if (tagKeys == null) {
            this.tagKeys = null;
            return;
        }

        this.tagKeys = new com.amazonaws.internal.SdkInternalList<String>(tagKeys);
    }

    /**
     *

     * The tag key (name) of the tag to be removed.
     *

     *

     * NOTE: This method appends the values to the existing list (if any). Use
     * {@link #setTagKeys(java.util.Collection)} or {@link #withTagKeys(java.util.Collection)} if you want to override
     * the existing values.
     *

     *
     * @param tagKeys
     *        The tag key (name) of the tag to be removed.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public RemoveTagsFromResourceRequest withTagKeys(String... tagKeys) {
        if (this.tagKeys == null) {
            setTagKeys(new com.amazonaws.internal.SdkInternalList<String>(tagKeys.length));
        }
        for (String ele : tagKeys) {
            this.tagKeys.add(ele);
        }
        return this;
    }

    /**
     *

     * The tag key (name) of the tag to be removed.
     *

     *
     * @param tagKeys
     *        The tag key (name) of the tag to be removed.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public RemoveTagsFromResourceRequest withTagKeys(java.util.Collection<String> tagKeys) {
        setTagKeys(tagKeys);
        return this;
    }

    /**
     * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
     * redacted from this string using a placeholder value.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getResourceId() != null)
            sb.append("ResourceId: ").append(getResourceId()).append(",");
        if (getTagKeys() != null)
            sb.append("TagKeys: ").append(getTagKeys());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof RemoveTagsFromResourceRequest == false)
            return false;
        RemoveTagsFromResourceRequest other = (RemoveTagsFromResourceRequest) obj;
        if (other.getResourceId() == null ^ this.getResourceId() == null)
            return false;
        if (other.getResourceId() != null && other.getResourceId().equals(this.getResourceId()) == false)
            return false;
        if (other.getTagKeys() == null ^ this.getTagKeys() == null)
            return false;
        if (other.getTagKeys() != null && other.getTagKeys().equals(this.getTagKeys()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getResourceId() == null) ? 0 : getResourceId().hashCode());
        hashCode = prime * hashCode + ((getTagKeys() == null) ? 0 : getTagKeys().hashCode());
        return hashCode;
    }

    @Override
    public RemoveTagsFromResourceRequest clone() {
        return (RemoveTagsFromResourceRequest) super.clone();
    }

}


text:
using System;
using System.Collections.Generic;
using System.Drawing;

#if __UNIFIED__
using CoreAnimation;
using Foundation;
using UIKit;
#else
using MonoTouch.CoreAnimation;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
#endif

namespace PopColorPicker.iOS
{
    public static class LayerHelper
    {
        public static void SetupShadow(CALayer layer)
        {
            layer.ShadowColor = UIColor.Black.CGColor;
            layer.ShadowOpacity = 0.8f;
            layer.ShadowOffset = new SizeF(0f, 2f);

            var rect = layer.Frame;
            rect.X = 0f;
            rect.Y = 0f;

            layer.ShadowPath = UIBezierPath.FromRoundedRect(rect, layer.CornerRadius).CGPath;
        }

        public static UIColor InverseColor(UIColor color)
        {
            var componentColor = color.CGColor.Components;
            var newColor = UIColor.FromRGBA(1f - componentColor[0], 1f - componentColor[1], 1f - componentColor[2], componentColor[3]);

            return newColor;
        }
    }
}


text:
Gravatar Service Provider
=========================

[![Build Status](https://img.shields.io/travis/EmanueleMinotto/GravatarServiceProvider.svg?style=flat)](https://travis-ci.org/EmanueleMinotto/GravatarServiceProvider)
[![SensioLabs Insight](https://img.shields.io/sensiolabs/i/876b86d7-429d-429d-9b01-07f01f2243df.svg?style=flat)](https://insight.sensiolabs.com/projects/876b86d7-429d-429d-9b01-07f01f2243df)
[![Coverage Status](https://img.shields.io/coveralls/EmanueleMinotto/GravatarServiceProvider.svg?style=flat)](https://coveralls.io/r/EmanueleMinotto/GravatarServiceProvider)
[![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/EmanueleMinotto/GravatarServiceProvider.svg?style=flat)](https://scrutinizer-ci.com/g/EmanueleMinotto/GravatarServiceProvider/)
[![Total Downloads](https://img.shields.io/packagist/dt/emanueleminotto/gravatar-service-provider.svg?style=flat)](https://packagist.org/packages/emanueleminotto/gravatar-service-provider)

A [Gravatar](http://www.gravatar.com) service provider for [Silex](http://silex.sensiolabs.org/).

API: [emanueleminotto.github.io/GravatarServiceProvider](http://emanueleminotto.github.io/GravatarServiceProvider/)

## Install
Install Silex using [Composer](http://getcomposer.org/).

Install the GravatarServiceProvider adding `emanueleminotto/gravatar-service-provider` to your composer.json or from CLI:

```
$ composer require emanueleminotto/gravatar-service-provider
```

## Usage

Initialize it using `register`

```php
use EmanueleMinotto\GravatarServiceProvider\GravatarServiceProvider;

$app->register(new GravatarServiceProvider(), array(
    'gravatar.http_client' => new GuzzleHttp\Client(), // default null, optional
    'gravatar.twig' => false, // default true, optional
));
```

The `gravatar.http_client` can be replaced by an instance of the [Guzzle](http://docs.guzzlephp.org/en/latest/) HTTP client,
by default a new instance is provided.

From PHP
```php
$app->get('/hello/{email}', function ($email) use ($app) {
    $profile = $app['gravatar']->getProfile($email);

    return 'Hello ' . $profile['preferredUsername'];
});
```

From [Twig](http://twig.sensiolabs.org/)

Setting the option `gravatar.twig => true`, if there's the [Twig service provider](http://silex.sensiolabs.org/doc/providers/twig.html), you'll be able to use the [Twig extension](https://github.com/EmanueleMinotto/Gravatar#twig-extension) provided by the [Gravatar library](https://github.com/EmanueleMinotto/Gravatar).


text:
<?xml version="1.0" encoding="UTF-8" ?>
<project name="maven-antrun-" default="main"  >
<target name="main">
  <mkdir dir="/home/shirdrn/git/hadoop-2.2.0/hadoop-project-dist/target/test-dir"/>
  <mkdir dir="/home/shirdrn/git/hadoop-2.2.0/hadoop-project-dist/target/test/data"/>
</target>
</project>


text:
title: "Kaukopartiohiihto 4.3.2005"
date: "2005-03-04"
tags: [hiihto]
gallery:
  - thb: "/assets/blog/kaukopartiohiihto-2005/Thumbnails/vaelluskaukopartio2005_01b.jpg"
    img: "/assets/blog/kaukopartiohiihto-2005/vaelluskaukopartio2005_01b.jpg"
  - thb: "/assets/blog/kaukopartiohiihto-2005/Thumbnails/vaelluskaukopartio2005_02b.jpg"
    img: "/assets/blog/kaukopartiohiihto-2005/vaelluskaukopartio2005_02b.jpg"
  - thb: "/assets/blog/kaukopartiohiihto-2005/Thumbnails/vaelluskaukopartio2005_03b.jpg"
    img: "/assets/blog/kaukopartiohiihto-2005/vaelluskaukopartio2005_03b.jpg"
  - thb: "/assets/blog/kaukopartiohiihto-2005/Thumbnails/vaelluskaukopartio2005_04b.jpg"
    img: "/assets/blog/kaukopartiohiihto-2005/vaelluskaukopartio2005_04b.jpg"
---

Kaukopartiohiihto houkutteli jälleen Salpausselälle väkeä ympäri Suomen.
Myös Kerkesix ry:n edustajat kunnioittivat tapahtumaa läsnäolollaan.
Ohessa hiihtäjien tunnelmia matkalta:

#### 150

"Lähdettiin pe aamupäivästä klo 10.30 Utista ja hiihdeltiin Pajulahteen,
jossa oltiin 20.30. Siellä sitten keiteltiin ja rupateltiin ja
yritettiin nukkua. Nukkumisesta ei kyllä tuullut mitään, kun oli niin
paljon häiriötekijöitä. Ilmastointi pauhas, valot oli päällä jne. No
pienen huilin jälkeen ruvettiin kolmen aikaan laittamaan kamoja kasaan
ja lähdettiin taas neljältä hiihtelemään lamppujen valossa.
Alkuryteikössä menin muutaman kerran nurin niillä SA-intin teettämillä
Peltosen erikoisuuksilla. Huoltoasema Matkakeitaalla syötiin sitten
aamiainen.. munaa, pekonia, lihapullia, nakkeja siis kaikkea sitä
hiilihydraattipitoista, joita pitkällä suorituksella kuuluukin syödä ;)
Sitten yli tunnin tauon jälkeen jatkettiin taas matkaa, loppu sujui ihan
hyvin, aurinko paistoi ja suksi luisti. Aina kun Utti tuli lähemmäksi
meidän vauhti kiihtyi selvästi. Lopussa mentiinkin jo tasatyöntöä ja
yritettiin jotain loppukirin poikasta. Pidettiin kuitenkin porukka
kasassa ja saavuttiin Tyrriin klo 14.00. Matkaa kertyi siis yhteensä
150km ja hiihtoaika molempiin suuntiin oli 10 tuntia. Kaiken kaikkiaan
reissu oli onnistunut ja erittäin hauska tapahtuma. Näin jälkeenpäin ei
ole lihaskipuja tai muuta suurempia vaivojakaan."

#### 75

"Oltiin lauantaiaamuna Utissa ja päästiin lähtemään 09.35. Ilma oli
mahtava ja aamulla oli jotain kymmenen astetta pakkasta. Sukset luisti
hyvin ja pitoakin löytyi tarpeeksi. Eka tauko pidettiin Paaskosken
majalla, jossa oli lämmintä mehua ja hieno koskimaisema. Siitä
jatkettiin Jokelan läpi kohti Kuusankoskea ja aurinko rupesi
lämmittämään kunnolla ja meinas tulla hiki. Ruskovillat oli vähän liikaa
alla. Pidettiin pieni tauko, jotta saatiin vaihdettua vähän kevyempää
päälle. Sitten hiihdeltiin se kiva ylämäki-alamäkiosuus Anhavaan, jonka
aikana suurin osa Pajulahdesta lähteneistä hiihtäjistä tuli vastaan.
Jostain syystä suksi ei oikein luistanut ja alamäissäkin piti lykkiä,
että vauhti ois riittänyt alas asti. Anhavalla oli kanssa jonkun verran
porukkaa, mutta sen jälkeen saatiinkin hiihdellä sitten aika rauhassa.
Muutamia yksittäisiä hiihtäjiä tuli silloin tällöin vastaan.

Matka Anhavalta Kausalan kautta Matkakeitaalle meni aika nopeesti
mahtavan kelin ja hyvän luiston ansiosta. Aurinko laski just kun
päästiin Matkakeitaalle, jossa pidettiin vajaan tunnin tauko.
Sämpylöitten jälkeen lähettiin taas liikenteeseen ja oli jo pimeää.
Auringon laskettua lämpötila laski aika paljon ja oli luultavasti jotain
vajaa -20c. Loppumatka meni aika hyvin tähtitaivasta ja revontulia
ihaillen ja oltiin Pajulahdessa vähän ennen puoltayötä. Hiihdeltiin aika
rauhassa, eikä pidetty mitään hirveetä kiirettä tauoilla, joten sen
takia meni taas aika myöhäiseksi. Se oli kyllä taas yhtä pitkä se vika
parin kilsan järvipätkä, kuin muistin. Pajulahti ei meinannu lähestyä
millään vaikka kuinka hiihti."


text:
<template name="repoMeteorPackage">

      <input type="checkbox" name="autopublish">
      Autopublish

</template>


text:
            <button class="btn btn-success btn-block" type="button" ng:click="vm.abrirModal()">
                 Novo Carro
            </button>

                <input type="text" class="form-control" placeholder="Pesquisar" ng:model="vm.search">

                    <button class="btn btn-default" type="button" ng:click="vm.filtrar()">

                    </button>

                                <input type="checkbox" ng:model="vm.allChecks" ng:click="vm.marqueAllChecks()" id="all">

                        Placa
                        Modelo
                        Marca
                        Foto
                        Combustível
                        Valor
                        Ações

                                <input type="checkbox" id="all_{{veiculo.id}}" ng:click="vm.ativaLinha(veiculo)" ng:checked="veiculo.linhaAtiva">

                        {{veiculo.placa}}
                        {{veiculo.modelo}}
                        {{veiculo.marca}}

                            Sem Foto

                                 {{veiculo.nomeImagem}}

                        {{veiculo.combustivel}}
                        {{veiculo.valorCorrigido}}

                            <button type="button" class="btn btn-warning btn-sm" ng:click="vm.editar(veiculo.id)">

                            </button>
                            <button type="button" class="btn btn-danger btn-sm" ng:click="vm.excluir(veiculo)">

                            </button>

                        Não tem veículos cadastrados

            <form id="veiculos" name="veiculos" ng:submit="vm.salvar(veiculos.$valid)" novalidate>

                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>

{{vm.titleModal}} Veículo

                            Placa
                            <input type="text" class="form-control" id="Placa" ng:keyup="vm.upper()" ng:blur="vm.validaPlaca()" name="Placa" maxlength="8"
                                ng:model="vm.Model.placa" required>
                            Informe a placa no padrão: ABC-1234

                            Marca
                            <select class="form-control" id="Marca" name="Marca" ng:change="vm.selecionaModelos()" ng:options="marca for marca in vm.listaMarcas"
                                ng:model="vm.Model.marca" required>
                                <option value="">Selecione</option>
                                <option value="{{marca}}">{{marca}}</option>
                            </select>

                            Modelo
                            <select class="form-control" id="Modelo" name="Modelo" ng:disabled="!vm.listaModelos.length" ng:options="modelo for modelo in vm.listaModelos"
                                ng:model="vm.Model.modelo" required>
                            <option value="" >Selecione</option>
                            <option value="{{modelo}}">{{modelo}}</option>
                        </select>

                            URL da Foto
                            <input type="url" class="form-control" id="UrlImagem" name="UrlImagem" ng:model="vm.Model.imagem">

                            Combustível
                            <select class="form-control" id="Combustivel" name="Combustivel" ng:model="vm.Model.combustivel">
                            <option value="">Selecione</option>
                            <option value="Álcool">Álcool</option>
                            <option value="Gasolina">Gasolina</option>
                            <option value="Flex">Flex</option>
                            <option value="Diesel">Diesel</option>
                        </select>

                            Valor
                            <input type="text" class="form-control" id="Valor" ng:keyup="vm.numeros();vm.corrigeValor();" name="Valor" maxlength="16"
                                ng:model="vm.Model.valor">

                            <button type="button" class="btn btn-block btn-default" data-dismiss="modal">Cancelar</button>

                            <button type="submit" class="btn btn-block btn-success" ng:disabled="veiculos.$invalid">Salvar</button>

            </form>


text:
#include <string>

#include "gtest/gtest.h"

#include "modules/common/configs/config_gflags.h"
#include "modules/map/hdmap/hdmap_util.h"
#include "modules/planning/common/planning_gflags.h"
#include "modules/planning/integration_tests/planning_test_base.h"

DECLARE_bool(reckless_change_lane);

namespace apollo {
namespace planning {

/**
 * @class SunnyvaleLoopTest
 * @brief This is an integration test that uses the sunnyvale_loop map.
 */

class SunnyvaleLoopTest : public PlanningTestBase {
 public:
  virtual void SetUp() {
    FLAGS_use_navigation_mode = false;
    FLAGS_map_dir = "modules/map/data/sunnyvale_loop";
    FLAGS_test_base_map_filename = "base_map_test.bin";
    FLAGS_test_data_dir = "modules/planning/testdata/sunnyvale_loop_test";
    FLAGS_planning_upper_speed_limit = 12.5;
    FLAGS_use_multi_thread_to_add_obstacles = false;
    ENABLE_RULE(TrafficRuleConfig::CROSSWALK, false);
    ENABLE_RULE(TrafficRuleConfig::PULL_OVER, false);
    ENABLE_RULE(TrafficRuleConfig::STOP_SIGN, false);
  }
};

/*
 * test stop for not-nudgable obstacle
 * A cruise test case
 */
TEST_F(SunnyvaleLoopTest, cruise) {
  std::string seq_num = "1";
  FLAGS_test_routing_response_file = seq_num + "_routing.pb.txt";
  FLAGS_test_prediction_file = seq_num + "_prediction.pb.txt";
  FLAGS_test_localization_file = seq_num + "_localization.pb.txt";
  FLAGS_test_chassis_file = seq_num + "_chassis.pb.txt";
  PlanningTestBase::SetUp();
  RUN_GOLDEN_TEST(0);
}

/*
 * stop case to trigger QP ST failed to solve
 */
// TODO(all): need fix test data.
// the existing obstacle is not along reference line and gets ignored
/*
TEST_F(SunnyvaleLoopTest, stop) {
  std::string seq_num = "2";
  FLAGS_test_routing_response_file = seq_num + "_routing.pb.txt";
  FLAGS_test_prediction_file = seq_num + "_prediction.pb.txt";
  FLAGS_test_localization_file = seq_num + "_localization.pb.txt";
  FLAGS_test_chassis_file = seq_num + "_chassis.pb.txt";
  FLAGS_test_routing_response_file = seq_num + "_routing.pb.txt";
  PlanningTestBase::SetUp();
  RUN_GOLDEN_TEST(0);
}
*/

/*
 * test follow a vehicle with medium distance
 * A follow test case
 */
TEST_F(SunnyvaleLoopTest, follow_01) {
  std::string seq_num = "3";
  FLAGS_test_routing_response_file = seq_num + "_routing.pb.txt";
  FLAGS_test_prediction_file = seq_num + "_prediction.pb.txt";
  FLAGS_test_localization_file = seq_num + "_localization.pb.txt";
  FLAGS_test_chassis_file = seq_num + "_chassis.pb.txt";
  PlanningTestBase::SetUp();
  RUN_GOLDEN_TEST(0);
}

/*
 * test nudge a static vehicle with medium distance
 * A nudge test case
 */
TEST_F(SunnyvaleLoopTest, nudge) {
  std::string seq_num = "4";
  FLAGS_test_routing_response_file = seq_num + "_routing.pb.txt";
  FLAGS_test_prediction_file = seq_num + "_prediction.pb.txt";
  FLAGS_test_localization_file = seq_num + "_localization.pb.txt";
  FLAGS_test_chassis_file = seq_num + "_chassis.pb.txt";
  PlanningTestBase::SetUp();
  RUN_GOLDEN_TEST(0);
}

/*
 * test follow a vehicle at right turn
 * A follow test case
 */
TEST_F(SunnyvaleLoopTest, follow_02) {
  std::string seq_num = "5";
  FLAGS_test_routing_response_file = seq_num + "_routing.pb.txt";
  FLAGS_test_prediction_file = seq_num + "_prediction.pb.txt";
  FLAGS_test_localization_file = seq_num + "_localization.pb.txt";
  FLAGS_test_chassis_file = seq_num + "_chassis.pb.txt";
  PlanningTestBase::SetUp();
  RUN_GOLDEN_TEST(0);
}

/*
 * test follow a vehicle at right turn with a close leading vehicle
 * A follow test case
 */
TEST_F(SunnyvaleLoopTest, follow_03) {
  std::string seq_num = "6";
  FLAGS_test_routing_response_file = seq_num + "_routing.pb.txt";
  FLAGS_test_prediction_file = seq_num + "_prediction.pb.txt";
  FLAGS_test_localization_file = seq_num + "_localization.pb.txt";
  FLAGS_test_chassis_file = seq_num + "_chassis.pb.txt";
  PlanningTestBase::SetUp();
  RUN_GOLDEN_TEST(0);
}

/*
 * test slowdown when dp_st_graph is failed.
 * A slowdown test case
 */
TEST_F(SunnyvaleLoopTest, slowdown_01) {
  std::string seq_num = "7";
  FLAGS_test_routing_response_file = seq_num + "_routing.pb.txt";
  FLAGS_test_prediction_file = seq_num + "_prediction.pb.txt";
  FLAGS_test_localization_file = seq_num + "_localization.pb.txt";
  FLAGS_test_chassis_file = seq_num + "_chassis.pb.txt";
  PlanningTestBase::SetUp();
  RUN_GOLDEN_TEST(0);
}

/*
 * test right turn.
 * A right turn test case
 */
TEST_F(SunnyvaleLoopTest, rightturn_01) {
  std::string seq_num = "8";
  FLAGS_test_routing_response_file = seq_num + "_routing.pb.txt";
  FLAGS_test_prediction_file = seq_num + "_prediction.pb.txt";
  FLAGS_test_localization_file = seq_num + "_localization.pb.txt";
  FLAGS_test_chassis_file = seq_num + "_chassis.pb.txt";
  ENABLE_RULE(TrafficRuleConfig::SIGNAL_LIGHT, false);
  PlanningTestBase::SetUp();
  RUN_GOLDEN_TEST(0);
}

/*
 * test right turn, but stop before trafic light
 * A right turn test case
 * A traffic light test case
 */
TEST_F(SunnyvaleLoopTest, rightturn_with_red_light) {
  std::string seq_num = "8";
  FLAGS_test_routing_response_file = seq_num + "_routing.pb.txt";
  FLAGS_test_prediction_file = seq_num + "_prediction.pb.txt";
  FLAGS_test_localization_file = seq_num + "_localization.pb.txt";
  FLAGS_test_chassis_file = seq_num + "_chassis.pb.txt";
  FLAGS_test_traffic_light_file = seq_num + "_traffic_light.pb.txt";
  PlanningTestBase::SetUp();
  RUN_GOLDEN_TEST(0);
}

/*
 * test change lane
 * A change lane test case
 */
TEST_F(SunnyvaleLoopTest, change_lane) {
  std::string seq_num = "9";
  FLAGS_test_routing_response_file = seq_num + "_routing.pb.txt";
  FLAGS_test_localization_file = seq_num + "_localization.pb.txt";
  FLAGS_test_chassis_file = seq_num + "_chassis.pb.txt";
  PlanningTestBase::SetUp();
  RUN_GOLDEN_TEST(0);
}

/*
 * test mission complete
 */
TEST_F(SunnyvaleLoopTest, mission_complete) {
  ENABLE_RULE(TrafficRuleConfig::PULL_OVER, false);

  std::string seq_num = "10";
  FLAGS_test_routing_response_file = seq_num + "_routing.pb.txt";
  FLAGS_test_localization_file = seq_num + "_localization.pb.txt";
  FLAGS_test_chassis_file = seq_num + "_chassis.pb.txt";
  PlanningTestBase::SetUp();

  // set config
  auto* destination_config =
      PlanningTestBase::GetTrafficRuleConfig(TrafficRuleConfig::DESTINATION);
  destination_config->mutable_destination()->set_enable_pull_over(false);

  RUN_GOLDEN_TEST(0);
}

/*
 * test change lane with obstacle at target lane
 */
TEST_F(SunnyvaleLoopTest, avoid_change_left) {
  std::string seq_num = "11";
  FLAGS_reckless_change_lane = true;
  FLAGS_test_chassis_file = seq_num + "_chassis.pb.txt";
  FLAGS_test_localization_file = seq_num + "_localization.pb.txt";
  FLAGS_test_prediction_file = seq_num + "_prediction.pb.txt";
  FLAGS_test_routing_response_file = seq_num + "_routing.pb.txt";
  PlanningTestBase::SetUp();
  RUN_GOLDEN_TEST(0);
}

/*
 * test qp path failure
 */
TEST_F(SunnyvaleLoopTest, qp_path_failure) {
  std::string seq_num = "12";
  FLAGS_reckless_change_lane = true;
  FLAGS_test_chassis_file = seq_num + "_chassis.pb.txt";
  FLAGS_test_localization_file = seq_num + "_localization.pb.txt";
  FLAGS_test_routing_response_file = seq_num + "_routing.pb.txt";
  PlanningTestBase::SetUp();
  RUN_GOLDEN_TEST(0);
}

/*
 * test change lane faillback
 * ADC position passed the change lane zone, failed to change to the new lane
 * and reroute is triggered but new rerouting result is not received yet.
 * Expect to keep going on the current lane.
 */
TEST_F(SunnyvaleLoopTest, change_lane_failback) {
  //// temporarly disable this test case, because a lane in routing cannot be
  //// found on test map.
  auto target_lane = hdmap::HDMapUtil::BaseMapPtr()->GetLaneById(
      hdmap::MakeMapId("2020_1_-2"));
  if (target_lane == nullptr) {
    AERROR << "Could not find lane 2020_1_-2 on map " << hdmap::BaseMapFile();
    return;
  }
  std::string seq_num = "13";
  FLAGS_reckless_change_lane = true;
  FLAGS_test_chassis_file = seq_num + "_chassis.pb.txt";
  FLAGS_test_localization_file = seq_num + "_localization.pb.txt";
  FLAGS_test_routing_response_file = seq_num + "_routing.pb.txt";
  FLAGS_test_prediction_file = seq_num + "_prediction.pb.txt";
  PlanningTestBase::SetUp();
  RUN_GOLDEN_TEST(0);
}

}  // namespace planning
}  // namespace apollo

TMAIN;


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.redhat.consulting.fusequickstarts.spring-boot</groupId>
    <artifactId>spring-boot-parent</artifactId>
    <version>7.6</version>
    <packaging>pom</packaging>

    <name>Fuse Quick Start :: Spring Boot :: Parent</name>
    <description>Parent POM for Fuse on Spring Boot Quick Starts. Defines all Dependencies and Plugins.</description>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <version.fuse>7.6.0.fuse-sb2-760028-redhat-00001</version.fuse>
        <version.maven-compiler-plugin>3.8.1</version.maven-compiler-plugin>
        <version.maven-surefire-plugin>2.12.4</version.maven-surefire-plugin>
        <version.maven-failsafe-plugin>2.12.4</version.maven-failsafe-plugin>
        <version.jacoco>0.8.5</version.jacoco>
        <version.commons-collections4>4.4</version.commons-collections4>

        <!-- versions copied from parent poms -->
        <version.cxf>3.2.7.fuse-sb2-760024-redhat-00001</version.cxf>
        <version.spring-boot>2.1.6.RELEASE</version.spring-boot>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.jboss.redhat-fuse</groupId>
                <artifactId>fuse-springboot-bom</artifactId>
                <version>${version.fuse}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-collections4</artifactId>
                <version>${version.commons-collections4}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                    <version>${version.spring-boot}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.cxf</groupId>
                    <artifactId>cxf-codegen-plugin</artifactId>
                    <version>${version.cxf}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${version.maven-compiler-plugin}</version>
                    <configuration>
                        <source>1.8</source>
                        <target>1.8</target>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${version.maven-surefire-plugin}</version>
                    <executions>
                        <execution>
                            <id>default-test</id>
                            <phase>test</phase>
                            <goals>
                                <goal>test</goal>
                            </goals>
                            <configuration>
                                <excludes>
                                    <exclude>**/*IntegrationTest.java</exclude>
                                </excludes>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>${version.maven-failsafe-plugin}</version>
                    <configuration>
                        <includes>
                            <include>**/*IntegrationTest.java</include>
                        </includes>
                    </configuration>
                    <executions>
                        <execution>
                            <id>default-integration-test</id>
                            <phase>integration-test</phase>
                            <goals>
                                <goal>integration-test</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>default-verify</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>verify</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${version.jacoco}</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <repositories>
        <repository>
            <id>redhat-ga-repository</id>
            <name>Red Hat General Availability repository (all)</name>
            <url>https://maven.repository.redhat.com/ga/</url>
            <layout>default</layout>
            <releases>
                <enabled>true</enabled>
                <updatePolicy>never</updatePolicy>
            </releases>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>never</updatePolicy>
            </snapshots>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>redhat-ga-repository</id>
            <name>Red Hat General Availability repository (all)</name>
            <url>https://maven.repository.redhat.com/ga/</url>
            <layout>default</layout>
            <releases>
                <enabled>true</enabled>
                <updatePolicy>never</updatePolicy>
            </releases>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>never</updatePolicy>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>
</project>


text:
import createPadding from './_createPadding.js';
import stringSize from './_stringSize.js';
import toInteger from './toInteger.js';
import toString from './toString.js';

/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeCeil = Math.ceil,
    nativeFloor = Math.floor;

/**
 * Pads `string` on the left and right sides if it's shorter than `length`.
 * Padding characters are truncated if they can't be evenly divided by `length`.
 *
 * @static
 * @memberOf _
 * @since 3.0.0
 * @category String
 * @param {string} [string=''] The string to pad.
 * @param {number} [length=0] The padding length.
 * @param {string} [chars=' '] The string used as padding.
 * @returns {string} Returns the padded string.
 * @example
 *
 * _.pad('abc', 8);
 * // => '  abc   '
 *
 * _.pad('abc', 8, '_-');
 * // => '_-abc_-_'
 *
 * _.pad('abc', 3);
 * // => 'abc'
 */
function pad(string, length, chars) {
  string = toString(string);
  length = toInteger(length);

  var strLength = length ? stringSize(string) : 0;
  if (!length || strLength >= length) {
    return string;
  }
  var mid = (length - strLength) / 2;
  return (
    createPadding(nativeFloor(mid), chars) +
    string +
    createPadding(nativeCeil(mid), chars)
  );
}

export default pad;


text:
var merge = require('merges-utils')
var base = require('./webpack.base.js')
var path = require('path');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');

var config = {
    entry: {
        index: './src/dev/index.js',
        vue: ['vue']
    },
    output: {
        path: path.resolve(__dirname, '../dist'),
        // publicPath: '/dist/',
        filename: 'js/[name].[chunkhash:8].js',
        chunkFilename: 'js/[name].[chunkhash:8].js'
    },
    resolve: {
        alias: {
            'vue$': 'vue/dist/vue.esm.js',
            'muse-components': 'muse-ui/src'
        },
        extensions: ['.js', '.vue', '.less']
    },
    devServer: {
        historyApiFallback: true,
        disableHostCheck: true,
        host: 'localhost',
        port: '9090',
        stats: 'normal'
    },
    devtool: 'source-map'
}

var res = merge([base, config]);
res.plugins = [
    new webpack.optimize.CommonsChunkPlugin({
        names: ['vue', 'common'],
        filename: 'js/[name].[chunkhash:8].js',
        minChunks: Infinity
    }),
    new HtmlWebpackPlugin({
        filename: 'index.html',
        template: 'src/dev/index.html',
        inject: true,
        hash: false,
        chunks: ['common', 'vue', 'index']
    })
].concat(res.plugins)

module.exports = res


text:
package com.gx.valueobject

import org.scalatest.{FlatSpec, Matchers}

class ValueObjectSpec extends FlatSpec with Matchers {

  it should "be equal for two value objects with same value" in {
    Point(1, 2) should be(Point(1, 2))
  }
}


text:
This repository contains the code for the SBGN homepage available at
http://sbgn.github.io/sbgn or http://www.sbgn.org

and provides access to the developer Wiki at
https://github.com/sbgn/sbgn/wiki

# Website Development

This website is a [GitHub Pages Jekyll-based website](https://jekyllrb.com/docs/github-pages/). GitHub Pages are public web pages for users, organizations, and repositories, that are freely hosted by GitHub. When commits are made to this repository files are automatically built into a static website by Jekyll and changes appear on the live website quickly. The main syntax of the website is Markdown (a Wikipedia MediaWiki-like syntax) that is described better in links below.

Contributions and changes can be made in several ways:

1. Downloading files using Git and pushed back to this repository directly or via pull requests. Please get in contact with one of the SBGN editors if you need commit permissions.
1. Through the online GitHub Editor by clicking the Edit menu on any .md file.
1. Submitting an issue on our [issue tracker](https://github.com/sbgn/sbgn/issues).

# Website Structure
## Menu Items

Menu items
https://github.com/sbgn/sbgn/blob/gh-pages/_includes/header.html

Earlier menu items are stored in
https://github.com/sbgn/sbgn/blob/gh-pages/_data/menu.yml

Rendered by the template
https://github.com/sbgn/sbgn/blob/gh-pages/_includes/header.html

## Pages

All pages are stored in
https://github.com/sbgn/sbgn/tree/gh-pages/docs

and rendered by the template
https://github.com/sbgn/sbgn/blob/gh-pages/_layouts/default.html

## Homepage

The main landing homepage (index.html) is rendered by this Markdown file:
https://raw.githubusercontent.com/sbgn/sbgn/gh-pages/_includes/index.md

# Using Markdown

* Jekyll Kramdown Notes: http://mindspill.net/computing/web-development-notes/kramdown-notes/#tables
* GitHub Jekyll Notes: https://github.com/blog/2100-github-pages-now-faster-and-simpler-with-jekyll-3-0
* Markdown syntax in GitHub: https://guides.github.com/features/mastering-markdown/

# Notes on GitHub (Troubleshooting Jekyll)

## Conflicts

If you edit a page in your browser it might happen that you see the message
"### has committed since you started editing. See what changed" while committing.
This means someone else was editing the page at the same time and did a commit prior to your commit.
To avoid data loss, copy your changes to an editor, updated the page you were about to edit, insert your changes, and do a commit.

## Editing index.(md,html)

The index.md exists in the _includes folder.

## Example Page Front Matter

Example [Jekyll Front Matter](https://jekyllrb.com/docs/frontmatter/) necessary to render a page correctly:

    ---
    title: A Human Readable Title
    layout: default
    permalink: /a_human_readable_title
    ---

NOTE: There is only one layout (i.e. default)

## Images
Example image code:

    ![alt text](/images/foo.png)

NOTE: If you need to directly link to an image found in a GitHub repository use the following URL syntax:

https://raw.githubusercontent.com/sbgn/glyph-files/master/simple_chemical/Symbol-simpleChemical.png

## Tables
* There must be an empty line below the table

## Linking
* File names should be at least 3 characters (WRONG: faq, RIGHT: faqs)
* Given the relative path in the Markdown links

### Example
* You need to give relative path
 * Example: faqs.md is in docs/ and pd.md is in docs/faq/

   We would like to provide a link of pd.md page in faq.md

   The path of the link to give: faq/pd
 * The syntax for creating a link is available [here](https://guides.github.com/features/mastering-markdown/).

## Redirects
In some cases, links will need to be redirected from a former location. This can be done with the following lines. The example redirects http://sbgn.github.io/sbgn/LibSBGN to https://github.com/sbgn/sbgn/wiki/LibSBGN

    ---
    redirect_to: https://github.com/sbgn/sbgn/wiki/LibSBGN
    ---

# Run Site Locally with Docker

## Get Docker
https://docs.docker.com/engine/installation/

## Get Docker images

### Jekyll with GitHub plugins
docker pull cannin/jekyll:gh

### HTTP Webserver
docker pull cannin/jekyll:gh

## Run Docker with Jekyll
docker stop jekyll; docker rm jekyll; docker run --rm --name=jekyll -p 4000:4000 -v=$(pwd):/src -it cannin/jekyll:gh bash

### Build in code root directory
bundle exec jekyll build --destination sbgn

## Run webserver
docker stop tmp; docker rm tmp; docker run --rm --name tmp -p 8080:8080 -v=$(pwd):/src -w /src -t cannin/nodejs-http-server

## Access site
http://localhost:8080/sbgn/

## Template Documentation
[https://github.com/orderedlist/minimal](https://github.com/orderedlist/minimal)


text:
import { shallowMount } from '@vue/test-utils';
import { testClassFromProps } from 'test/utils';
import Segment from 'semantic-ui-vue/elements/Segment/Segment';

describe('Segment', () => {
  testClassFromProps(Segment, [
    'attached',
    'basic',
    'padded',
    'inverted',
    'stacked',
    'piled',
    'raised',
    'vertical',
  ]);

  it('should create a SUI Segment', () => {
    const segment = shallowMount(Segment);
    expect(segment.is('div')).toEqual(true);
    expect(segment.classes()).toContain('ui');
    expect(segment.classes()).toContain('segment');
  });

  it('should have content', () => {
    const segment = shallowMount(Segment, {
      slots: { default: 'bar' },
    });
    expect(segment.text()).toEqual('bar');
  });
});


text:
#ifndef __TRANSMISSION__
#error only libtransmission should #include this header.
#endif

#ifndef _TR_PTR_ARRAY_H_
#define _TR_PTR_ARRAY_H_

/**
 * A simple pointer array that resizes itself dynamically.
 */
typedef struct tr_ptrArray tr_ptrArray;

typedef void ( *PtrArrayForeachFunc )( void * );

tr_ptrArray * tr_ptrArrayNew( void );

tr_ptrArray * tr_ptrArrayDup( tr_ptrArray* );

void          tr_ptrArrayForeach( tr_ptrArray         * array,
                                  PtrArrayForeachFunc   func );

void          tr_ptrArrayFree( tr_ptrArray         * array,
                               PtrArrayForeachFunc   func );

void*         tr_ptrArrayNth( tr_ptrArray   * array,
                              int             nth );

void*         tr_ptrArrayBack( tr_ptrArray  * array );

void**        tr_ptrArrayPeek( tr_ptrArray  * array,
                               int          * size );

void**        tr_ptrArrayBase( tr_ptrArray  * array );

void          tr_ptrArrayClear( tr_ptrArray * array );

int           tr_ptrArrayInsert( tr_ptrArray * array,
                                 void        * insertMe,
                                 int           pos );

int           tr_ptrArrayAppend( tr_ptrArray * array,
                                 void        * appendMe );

void*         tr_ptrArrayPop( tr_ptrArray    * array );

void          tr_ptrArrayErase( tr_ptrArray  * array,
                                int            begin,
                                int            end );

int           tr_ptrArraySize( const tr_ptrArray* );

int           tr_ptrArrayEmpty( const tr_ptrArray* );

int           tr_ptrArrayInsertSorted( tr_ptrArray * array,
                                       void        * value,
                                       int compare(const void*, const void*) );

void*         tr_ptrArrayRemoveSorted( tr_ptrArray * array,
                                       void        * value,
                                       int compare(const void*, const void*) );

void*         tr_ptrArrayFindSorted( tr_ptrArray * array,
                                     const void  * key,
                                     int compare(const void*, const void*) );

#endif


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><meta content="text/html;charset=utf-8" http-equiv="content-type"></meta><link rel="stylesheet" type="text/css" href="v8help://service_book/service_style"></link><meta name="GENERATOR" content="MSHTML 11.00.9600.18427"></meta>

Просмотр сведений о версии файла.

По окончании редактирования файла (по команде Завершить редактирование в списке файлов) программа рекомендует сохранить версию файла и ввести информацию о данной версии. По умолчанию эта возможность включена (рекомендуется использовать сохранение версий, так как в случае серьезных ошибок, которые привели к порче файла, можно вернуться к более ранней, неиспорченной версии). Впоследствии можно отредактировать комментарий и при необходимости изменить автора версии.

Сведения о версии файла

Владелец - наименование файла-владельца, автоматически заполняется при добавлении версии, не подлежит редактированию;

Наименование - наименование версии, автоматически заполняется при добавлении версии, не подлежит редактированию;

Родительская версия - для того чтобы подчинить одну версию другой, выберите из списка нужную версию. История версий в программе для наглядности представляется в виде дерева;

Размер (байт) - размер данных версии файла в байтах.

Расширение - расширение (формат) версии файла. Рядом располагается картинка, которая также показывает формат версии файла, определяется программой автоматически.

Комментарий к версии - введите дополнительные сведения о версии файла (также можно ввести при сохранении версии по окончании редактирования файла).

Автор - пользователь, который добавил версию файла. При необходимости можно выбрать другого автора из списка пользователей.

Дата создания - дата и время добавления версии файла в базу.

Номер версии - нумерация версий ведется программой автоматически при изменениях файла, при этом максимальный номер имеет последняя сохраненная версия.

Дата изменения - дата изменения данных версии файла (местное время).

Кодировка - автоматически выбирается значение По умолчанию.

Просмотр версии файла

Нажмите Просмотреть, для того чтобы открыть выбранную версию файла соответствующим приложением для просмотра или редактирования (также можно открыть версию файла двойным щелчком мыши по нужной строке или с помощью соответствующей команды меню Еще).

Сохранение версии файла на диск

Для того чтобы сохранить версию файла на диск или другое устройство,нажмите Сохранить как. Выберите каталог для сохранения файла.

См. также:

Версии файла;

Файлы.